5.29 (Peter Minuit Problem) Legend has it that, in 1626, Peter Minuit purchased
ID: 3622366 • Letter: 5
Question
5.29 (Peter Minuit Problem) Legend has it that, in 1626, Peter Minuit purchased Manhattan Island for $24.00 in barter. Did he make a good investment? To answer this question, modify the compound interest program of Fig. 5.6 to begin with a principal of $24.00 and to calculate the amount of interest on deposit if that money had been kept on deposit until this year (e.g., 384 years through 2010). Place the for loop that performs the compound interest calculation in an outer for loop that varies the interest rate from 5% to 10% to observe the wonders of compound interest. Please use setw, setprecision and any other built in functions to make your output readable.amount = principal * pow(1.0 + rate, year)
Explanation / Answer
#include //Allows program to perform input and output using std::cout; //program uses cout using std::cin; //program uses cin using std::endl; //program uses endl using std::fixed; //program uses fixed # include using std::setw; //enables program to set a field width using std::setprecision; # include //standard C++ math library using std::pow; //program uses pow //function main begins program execution int main() { double amount; double principal = 24.0; coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.