Block of Code

Practical Examples for Programmers

  • Home
  • C++
  • Java
  • Visual Basic
  • Discrete Math
  • Ask a Question

Rule of 72

This rule is used to approximate the time required for prices to double due to inflation.  If the inflation rate is r %, then the Rule of 72 estimates that prices will double in 72/r years.  For instance, at an inflation rate of 6%, prices double in about 72/6 or 12 years.  Using Visual Basic, write a program to test the accuracy of this rule.  For each interest rate from 1% to 20%, the program should display the rounded value of 72/r and the actual number of years required for prices to double at an r% inflation rate.  (Assume prices increase at the end of each year.)  See the figure below.

Rule of 72 Screenshot

Suggested Control Names and Attributes:

Name Property Text Property Control Type Notes
 frmRuleOf72 Rule of 72 Form Holds Controls
 btnEvaluate Evaluate Rate Button Triggers event to display calculations
 lstOutput ListBox Diplays calculations

Secondary Sidebar

This is the secondary sidebar

Copyright © 2025 · Metro Pro Theme on Genesis Framework · WordPress · Log in