Question: 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

 Please help woth the code in C++ Write a complete C++

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!