Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help woth the code in C++ Write a complete C++ program to report on the inflation rate for an item. The inflation rate is

image text in transcribed

Please help woth the code in C++

Write a complete C++ program to report on the inflation rate for an item. The inflation rate is defined as (currentCost - yearAgoCost) / yearAgoCost Input, in a file named prices.txt, has text identifying the item on the first line. The second line has the yearAgoCost value, some spaces, then the currentCost value. One input example is: Hot dog with everything 10.75 12.05 A second input example could be: Oak Table 1099.99 2100.99 Output is written to a file named rate.txt; it identifies the item and its inflation rate both as a decimal and as a percent. Show 5 decimal places. For the first example of input shown above, the output appears as follows: Inflation rate for Hot dog with everything is.12093 which is 12.093%. Extra Credit: Also output the statement Inflation rate is too high. if the inflation rate is over 5.0%. If the inflation rate is greater than 2.0% but less than or equal to 5.0%, output Inflation rate is somewhat high If the inflation rate is 2.0% or less, output Inflation rate is reasonable

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

Databases Illuminated

Authors: Catherine M. Ricardo, Susan D. Urban, Karen C. Davis

4th Edition

1284231585, 978-1284231588

More Books

Students also viewed these Databases questions

Question

ne disadvantage of using the Internet as an advertising medium

Answered: 1 week ago