Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
c++
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

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

Students also viewed these Databases questions

Question

1. What is Ebola ? 2.Heart is a muscle? 3. Artificial lighting?

Answered: 1 week ago