/************************************************************* * ruleof72.cpp calculates the approximate time it takes to double * a user's investment. * Input: Annual interest rate as a percent * * Output : Number of years it takes to double the investment * Programmed By: Mark Cruz * Block 2B * Date 9/24/2002 ***************************************************************/ #include // cin, cout, <<, >> #include // pow() int main() { cout << "Howdy, please enter your annual interest as a percent:"; double interest; cin >> interest; double year = 72/interest; cout <<"\nThe amount of time it will take to double your investment is " << year << " years. \n "; cout << endl; return 0; /* Howdy, please enter your annual interest as a percent:12.5 The amount of time it will take to double your investment is 5.76 years. Press any key to continue Howdy, please enter your annual interest as a percent:8 The amount of time it will take to double your investment is 9 years. Press any key to continue Howdy, please enter your annual interest as a percent:4 The amount of time it will take to double your investment is 18 years. Press any key to continue */ }