Question: c++ Branching Statements Objective: Learn how to -- use switch, break and continue statements Problem: Joel is writing a program that figures interest on money
Branching Statements Objective: Learn how to -- use switch, break and continue statements Problem: Joel is writing a program that figures interest on money that is held in a bank. The amount of interest that money earns in this bank depends on which type of account the money is in. There are 5 different types of accounts and they carn interest as follows: account type code account type name interest earned per year personal financial 2.3% personal homeowner 2.6% personal gold 2.9% small business 3.3% big business 3.5% Joel has assigned numbers to the account types starting with personal financial and ending with gold business. In your main function, you must repeatedly prompt user to input the deposit amount and types of account and then calculate the interest after one year and five years. You must handle the errors if the input deposit amount is negative or account type code is invalid. Requirements: You must use switch, break and contime statements. You must handle the errors. Suggested screen design: Enter deposit type: 1 for personal financial 2 for personal homeowner 3 for personal gold 4 for small business 5 for big business -1 to quit Invalid code. Please try again Enter deposit type: 1 for personal financial 2 for personal homeowner 3 for personal gold 4 for small business 5 for big business -1 to quit Enter the deposit amount: -4500 Deposit amount must be positive. Try Again: Enter the deposit amount: -2300 Deposit amount must be positive. Try Again: Enter the deposit amount: 5678 The interests after one year and five years are: 5187.37 and $1000.78 Enter deposit type: -1 to quit Good bye
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
