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

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter2: Using Data
Section: Chapter Questions
Problem 4E: In this chapter, you learned that although a double and a decimal both hold floating-point numbers,...
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
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr