Program: The annual fee of inflation is the rate at which money loses its value. For example, if the annual rate of inflation is 3.0 percent, then in one year it will cost $1,030 to buy the goods that would have been purchased for $1000 today. Put another way, a year from now $1,000 will only buy 1/1.03 * $1,000, or $970.87, worth of goods. Two years from now, $1,000 will only buy only 1/1.03 of $970.87, or 942.59 worth of goods.  Write a program that allows the user to enter an annual rate of inflation between 1 percent and 10 percent, and which then displays a table showing how much $1,000 today will be worth each year for the next 10 years. Input Validation: Decide how the program should handle rates less than zero.  Using Const to represent starting value, min inflation rate, and maximum inflation rate Display formatted results, using fixed, and setpercision(2)

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

All programs must include introductory comments as well as comments all throughout the program. The introductory comment should include your name, the class name with section (e.g. CS 101 -24900), the program name, and a  brief description of the program.

No need for pseudocode anymore!

Write your program in C++ with Visual Studio, or an online compiler - compile, and execute it.

For visual studio users;

Don't forget to use the system ("pause")  before the "return" statement at the end of your program. 

 

Program:

The annual fee of inflation is the rate at which money loses its value. For example, if the annual rate of inflation is 3.0 percent, then in one year it will cost $1,030 to buy the goods that would have been purchased for $1000 today.

Put another way, a year from now $1,000 will only buy 1/1.03 * $1,000, or $970.87, worth of goods. Two years from now, $1,000 will only buy only 1/1.03 of $970.87, or 942.59 worth of goods. 

Write a program that allows the user to enter an annual rate of inflation between 1 percent and 10 percent, and which then displays a table showing how much $1,000 today will be worth each year for the next 10 years.

Input Validation: Decide how the program should handle rates less than zero. 

Using Const to represent starting value, min inflation rate, and maximum inflation rate

Display formatted results, using fixed, and setpercision(2)

Enter the annual rate of inflation (between 0.01 and 0.10) : .03
Year
Worth
Current
1000.00
1
970.87
2
942.60
915.14
4
B88.49
5
862.61
6
837.48
7
813.09
789.41
9
766.42
10
744.09
Transcribed Image Text:Enter the annual rate of inflation (between 0.01 and 0.10) : .03 Year Worth Current 1000.00 1 970.87 2 942.60 915.14 4 B88.49 5 862.61 6 837.48 7 813.09 789.41 9 766.42 10 744.09
-/main
Enter the annual rate of inflation (between 0.01 and 0.10): -4
Inflation rate must be between 0.01 and 0.10 -- Re-enter rate:
Transcribed Image Text:-/main Enter the annual rate of inflation (between 0.01 and 0.10): -4 Inflation rate must be between 0.01 and 0.10 -- Re-enter rate:
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Random Class and its operations
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