Answered You can hire a professional tutor to get the answer.

QUESTION

Im making a program in c# where it takes these parameters and makes a class for it but am having trouble starting it off.

Im making a program in c# where it takes these parameters and makes a class for it but am having trouble starting it off.

1) Account class

   Implement private fields with public setters and getters in the Account class - use appropriate data types as discussed in class

                AccountNumber - should allow only for 20 digits, including leading zeros, but NO LETTERS - example value: "00045678493857683928".   Your setter should set empty if validation fails.  - "Numbers" allowing for leading zeros are really just strings. If less than 20 digits or more than 20 digits set to empty string

                AccountType - "Savings" or "Checking" - no other types or string should be accepted in this setter. If I pass "MoneyMarket" the setter should default this property to empty. Casing can be ignored - for example, "SAVINGS" and "savings" can be accepted. I will accept strings but can also be enum. 

                AccountBalance - How much money is in the account. Balance should never be less than zero. If your setter allows for setting a value less than zero you will lose points. You should check the value first, and if it is less than zero, just set the balance to zero.

   Implement the following public methods (behaviors) in the Account class

                Default constructor - no arguments but the properties are initialized to non-null values.

                Parameterized constructor - arguments for all properties can be passed (AccountNumber, AccountType, AccountBalance)

                ToString - return a formatted string with labels for each of the following: account number, account type, and balance. AccountBalance should be formatted with a $ and decimals. This should be in a single string on 1 line.

                               - ex: "Account number: 11111111111111111111 Account type: Checking Account Balance: $500.00"

                Equals - accept an object as a parameter, cast it to an Account type, and compare the following

                               - Whether the Account number, Account type, and Account balance match. If they match return true, else return false

                - Ignore mixed casing on Account type - Use ToUpper or ToLower to ignore casing

                                "CHECKING" should match "checking", etc.

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question