Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Objective: Learn how to -- use switch, break and continue statements Problem: Joel is writing a program that figures interest on money that is held

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 eam interest as follows: account type code interest earned per year account type name personal financial personal homeowner personal gold small business 2.3% 2.6% 2.9% 4 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 contimue statements. You must handle the errors. Suggested screen design: Enter deposit type: 1 for personal financial 2 for personal homeowner 3 for parsonal gold 4 for small business 5 for big business -1 to quit Invalid code. Please try again Enter deposit type! 1 for parsonal financial 2 for personal homeowner 3 for parsonal gold 4 for smal1 business 5 for big business -1 to quit Enter the deposit amount: -4500 Deposit anount must be positive. Iry Again: Enter the deposit amount: -2300 Deposit amount must be positive. 7ry Again: Enter the deposit amount: 5678 The interests after one vear and five vears are: $187.37 and $1000.78 Enter deposit type: -1 to quit -1 Good bye

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

Professional Android 4 Application Development

Authors: Reto Meier

3rd Edition

1118223853, 9781118223857

More Books

Students also viewed these Programming questions