posted by James Starr on .
The rule of 72 is use to make a quick estiment of the time required for prices to double due to inflation. If the inflation rate is (r)percent, then the rule of 72 estimates that prices will double in 72/r years. For instance, at an inflation rate of 6 percent, prices double in about 72/6 or 12 years. Write a program to test the accuracy of this rule. The program should display a table showing, for each value of (r) from 1 to 20, the rounded value of 72/r and the actual amount number of years required at the end of each year).