Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C# Please Concept Summary: 1. Inheritance 2. Over-riding methods 3. Instantiating objects 4. Fundamental Class Concepts. 5. Using your IDE to generate UML diagrams. Objective:

C# Please image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
Concept Summary: 1. Inheritance 2. Over-riding methods 3. Instantiating objects 4. Fundamental Class Concepts. 5. Using your IDE to generate UML diagrams. Objective: In this lab, you'll be creating software for the world's smallest bank. This bank can have only one customer. The customer will have a checking account and a savings account. The account types have some specific rules: Checking Accounts: Allows unlimited deposits and withdrawals for free. Provides no interest payments. If the account balance ever drops below $0, the customer is charged a $20 overdraft fee. Saving Accounts: Must maintain a $500 balance at all times, otherwise the customer is charged S10 cach time they make a withdrawal that lowers their balance below $500. Earns 1.5% interest every year The first 5 deposits are free, after that there is a fee of $10 per deposit You'll provide the bank teller with a simple menu which will allow them to make changes to their customer's accounts. You'll use your IDE to generate UML diagrams of your classes. See UML section below. Account Numbers: Each account will have an account number. You should use a static variable to keep track of the next account number. At the start set this number to 10001. In your driver you'll create a Checking account, and a Savings account. The checking account will end up with a account number of 10001, while the Savings account will end up with an account number of 10002 o Classes: Create a class called "Account". This will hold things that are true for all account types. Be sure to include at least: o An attribute which will hold the account number. An attribute which will hold the account balance. (c.g. $500.22) o A constructor method which opens the account with a balance of 0. It should set the account number using the static variable described above. An overloaded constructor which opens the account with a specific amount which is passed to the constructor It should set the account number using the static variable described above. o Getter method for accessing the account_number. o Getter/Setter method for accessing the account balance. A withdrawal method which takes a parameter of the amount to be withdrawn and deducts it from the balance. A deposit method which takes a parameter of the amount to be deposited and adds it to the balance Create a class called "Checking" which should inherit from Account You will need an appropriate constructor to set the account balance. Modify the withdrawal method you inherited to check for the condition where they try to overdraft their account If an overdraft condition occurs you should print out "Charging an overdraft fee of $20 because account is below 50" Deduct $20 from their balance. Create a class called "Savings" which should inherit from Account You will need an appropriate constructor to set the account balance. Modify the withdrawal method so it implements the rules about dropping below $500 . If they drop below $500, you should print "Charging a fee of $10 because you are below $500 Deduct $10 from their balance Modify the deposit method so it implements the charge for more than 5 deposits. . As you do the deposit you should print "This is deposit I to this account", where I would be updated to reflect what number deposit this is. If you are doing the 6th or later deposit, print "Charging a few of S10", and deduct S10 from their balance. Add a method which adds 1.5% interest to the account. (This method will be called by the teller manually once per year). - Print out how much the customer carned in interest as follows "Customer camed 15.25 in interest". Of course it should reflect the actual amount. Add the interest eamed to their balance. All classes should be created with appropriate encapsulation. Le account balances and account numbers should be private and only accessible via getters/setters Don't worry if the formatting of the dollar figures. Ie, sometimes the interest will be 2.585828225 and that's ok. Likewise sometimes the balance will be 100.5 and that's ok for this lab. Driver: Create a driver class which creates a checking and savings account. Then keep prompting the user with the following menu until they quit: 1. Withdraw from Checking 2. Withdraw from Savings 3. Deposit to Checking 4. Deposit to Savings 5. Balance of Checking 6. Balance of Savings 7. Award Interest to Savings now 8. Quit Each menu choice should prompt the user as appropriate to do what it says. i.e. if the user selects Deposit to Checking, they should be prompted for the amount. See sample output below. Sample Output: 1. Withdraw from Checking 2. Withdraw from Savings 3. Deposit to Checking 4. Deposit to Savings 5. Balance of Checking 6. Balance of Savings 7. Award Interest to Savings now 8. Quit How much would you like to deposit into Checking? 50 Doing default deposit 1. Withdraw from Checking 2. Withdraw from Savings 3. Deposit to Checking 4. Deposit to Savings 5. Balance of Checking 6. Balance of Savings 7. Award Interest to Savings now 8. Quit 1 How much would you like to withdraw from Checking? 30 1. Withdraw from Checking 2. Withdraw from Savings 3. Deposit to Checking 4. Deposit to Savings 5. Balance of Checking 6. Balance of Savings 7. Award Interest to Savings now 8. Quit 5 Your balance for checking 10001 is 200 1. Withdraw from Checking 2. Withdrew from Savings Yo LD LO The 1. W 3. Deposit to Checking 4. Deposit to Savings 5. Balance of Checking 6. Balance of Savings 7. Award Interest to Savings now 8. Quit 1 How much would you like to withdraw from Checking? 30 Charging an overdraft fee of $20 because account is below 50. 1. Withdraw from Checking 2. Withdraw from Savings 3. Deposit to Checking 4. Deposit to Savings 5. Balance of Checking 6. Balance of Savings 7. Award Interest to Savings now 8. Quit 5 Your balance for checking 10001 is -30.0 1. Withdraw from Checking 2. Withdraw from Savings 3. Deposit to Checking 4. Deposit to Savings 5. Balance of Checking 6. Balance of Savings 7. Award Interest to Savings now 8. Quit 6 Your balance for savings 10002 is 0.0 1. Withdraw from Checking 2. Withdraw from Savings 3. Deposit to Checking 4. Deposit to Savings 5. Balance of Checking 6. Balance of Savings 7. Award Interest to Savings now 8. Quit How much would you like to deposit into Savings? 500 This is deposit number 1 to this account 1. Withdraw from Checking 4 2. Withdraw from Savings 3. Deposit to Checking 4. Deposit to Savings 5. Balance of Checking 6. Balance of Savings 7. Award Interest to Savings now 8. Quit 4 How much would you like to deposit into Savings? 300 This is deposit number 2 to this account. 1. Withdraw from Checking 2. Withdraw from Savings 3. Deposit to Checking 4. Deposit to Savings 5. Balance of Checking 6. Balance of Savings 7. Award Interest to Savings now 8. Quit 6 Your balance for savings 10002 is 800.0 1. Withdraw from Checking 2. Withdraw from Savings 3. Deposit to Checking 4. Deposit to Savings 5. Balance of Checking 6. Balance of Savings 7. Award Interest to Savings now 8. Quit How much would you like to deposit into Savings? 100 This is deposit sumber 3 to this account. 1. Withdraw from Checking 2. Withdraw from Savings 3. Deposit to Checking 4. Deposit to Savings 5. Balance of Checking 6. Balance of Savings 7. Award Interest to Savings now 8. Quit 4 How much would you like to deposit into Savings? 4 100 This is deposit number 4 to this account. 1. Withdraw from Checking 2. Withdraw from Savings 3. Deposit to Checking 4. Deposit to Savings 5. Balance of Checking 6. Balance of Savings 7. Award Interest to Savings now 8. Quit 4 How much would you like to deposit into Savings? 100 This is deposit number 5 to this account 1. Withdraw from Checking 2. Withdraw from Savings 3. Deposit to Checking 4. Deposit to Savings 5. Balance of Checking 6. Balance of Savings 7. Award Interest to Savings now 8. Quit How much would you like to deposit into Savings? 100 This is deposit number 6 to this account. Charging a fee of $10 1. Withdraw from Checking 2. Withdraw from Savings 3. Deposit to Checking 4. Deposit to Savings 5. Balance of Checking 6. Balance of Savings 7. Award Interest to Savings now 8. Quit 6 Your balance for savings 10002 in 1190.0 1. Withdraw from Checking 2. Withdraw from Savings 3. Deposit to Checking 4. Deposit to Savings 5. Balance of Checking 6. Balance of Savings 8. Quit 7. Award Interest to Savings now 8. Quit 7 Customer comed 17.849999999999998 in interest 1. Withdraw from Checking 2. Withdraw from Savings 3. Deposit to Checking 4. Deposit to Savings 5. Balance of Checking 6. Balance of Savings 7. Award Interest to Savings now 8. Quit 6 Your balance for savings 10002 is 1207.85 1. Withdraw from Checking 2. Withdraw from Savings 3. Deposit to Checking 4. Deposit to Savings 5. Balance of Checking 6. Balance of Savings 7. Award Interest to Savings now 8. Quit 2 How much would you like to withdraw from Savings? 750 Charging a fee of S10 bocouse you are below $500. 1. Withdrew from Checking 2. Withdraw from Savings 3. Deposit to Checking 4. Deposit to Savings S. Balance of Checking 6. Balance of Savings 7. Award Interest to Savings now 8. Out 6 Your balance for savings 10002 is 447.85 1. Widdraw from Checking 2. Withdraw from Savings 3. Deposit to Checking 4, Deposit to Savings 5. Balance of Checking 6. Balance of Savings 7. Award Interest to Savings now

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

How does the concept of hegemony relate to culture?

Answered: 1 week ago