In this question, you will rite a makes each year over a specified number of years. Users are prompted for basic savings, the interest rate (in % per year), and the number of years fo the employee wants the program to calculate the yearly amount earned. For example, if the user has $100 in the saving account, and has a 5% interest rate then the 1st ye interest amount is $100 x 5% = $5

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
In this question, you will write a complete C++ program that calculates the interest amount a customer
makes each year over a specified number of years.
Users are prompted for basic savings, the interest rate (in % per year), and the number of years for which
the employee wants the program to calculate the yearly amount earned.
For example, if the user has $100 in the saving account, and has a 5% interest rate then the 1st year the
interest amount is $100 x 5% = $5
At the beginning of each year, ask the user whether he would like to save more money. If the answer is
"yes", then ask the amount. For example, save $5,000 more into the saving account, then the total
interest amount is ($100 + $5+ $5,000)*5% = $255.25 and so on.
Assume you have a perfect user who enters positive numbers. You are required to use while loop, not
other loops to solve this question. (Failing to do so will result in a grade of zero)
Necessary comments are required.
Here is a sample output screen to illustrate the expected behavior of your program. Your program
should work for any values entered, not just the ones in the sample output screen below.
Please enter the starting amount in your saving account: 1000
Please enter the interest rate: 2.6
Please enter the number of years: 3
Here are the results:
1 year, the interest amount is:26.00
Would you like to save more money? no
The amount in your account is: 1026.00
2 year, the interest amount is:26.68
Would you like to save more money? yes
How much would you like to save? 1000-
The amount in your account is: 2052.68
3 year, the interest amount is:53.37
The amount in your account is: 2106.05
The total interest amount is 106.05
Thank you for using this program!
Program ended with exit code: 0
Transcribed Image Text:In this question, you will write a complete C++ program that calculates the interest amount a customer makes each year over a specified number of years. Users are prompted for basic savings, the interest rate (in % per year), and the number of years for which the employee wants the program to calculate the yearly amount earned. For example, if the user has $100 in the saving account, and has a 5% interest rate then the 1st year the interest amount is $100 x 5% = $5 At the beginning of each year, ask the user whether he would like to save more money. If the answer is "yes", then ask the amount. For example, save $5,000 more into the saving account, then the total interest amount is ($100 + $5+ $5,000)*5% = $255.25 and so on. Assume you have a perfect user who enters positive numbers. You are required to use while loop, not other loops to solve this question. (Failing to do so will result in a grade of zero) Necessary comments are required. Here is a sample output screen to illustrate the expected behavior of your program. Your program should work for any values entered, not just the ones in the sample output screen below. Please enter the starting amount in your saving account: 1000 Please enter the interest rate: 2.6 Please enter the number of years: 3 Here are the results: 1 year, the interest amount is:26.00 Would you like to save more money? no The amount in your account is: 1026.00 2 year, the interest amount is:26.68 Would you like to save more money? yes How much would you like to save? 1000- The amount in your account is: 2052.68 3 year, the interest amount is:53.37 The amount in your account is: 2106.05 The total interest amount is 106.05 Thank you for using this program! Program ended with exit code: 0
Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Knowledge Booster
Constants and Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education