Calculating the island of Manhattan gains after 400 years.

  • Thread starter Thread starter lcam2
  • Start date Start date
  • Tags Tags
    Years
AI Thread Summary
The discussion revolves around calculating the financial gains from the original purchase of Manhattan for $24 in 1626, assuming the amount was invested at a 5% simple interest rate. A user is attempting to create a C++ program to display the total money accumulated every 50 years up to 2026 but is facing issues with the calculations. Suggestions include correcting the code by removing unnecessary increments to the total money variable and using an integer for the year to avoid decimal inaccuracies. Additionally, a comparison with compound interest reveals that the investment would yield significantly higher returns, amounting to over $7 billion by 2026. The conversation highlights both coding challenges and financial implications of the investment scenario.
lcam2
Messages
28
Reaction score
0
According to the legend, the island of Manhattan was purcased from the native indian population in 1626 for 24 dollars. Assuming this money was invested in a Dutch bank paying 5 %
simple interest per year, costruct a table in C++ showing how much money the native population would have at the end of each 50- year period, starting in 1626 and ending 400 years latter.
I'm having problems when i try to calculate the total amount of money every 50 year period.
Thanks in advance.



Homework Equations



simple Interest = Principal amount * Interest rate * years



The Attempt at a Solution




#include <iostream>
#include <cmath>
#include <iomanip>

using namespace std;
int main ()

{
float year;
double rate, interest, totMoney;

year = 1626;
rate = .05;

cout << " Year Interest gained Total Money" << endl;
cout << "-----------------------------------------------"<< endl;
cout << endl;




while( year <= 2026)
{


interest = 24 * .05* 50;
totMoney = 24 + interest;


cout << setw(7) << year << setw(15) << interest << setw(15)<< totMoney << endl;

cout << endl;

totMoney ++;

year += 50;


}




return 0;
}
 
Physics news on Phys.org
The basic algorithm looks all right (I'd clean up the output format a little, but that's just me). However, is there a reason you're incrementing totMoney (totMoney++)? Does the legend include a $1 payment every 50 years?

I'd also suggest using an int for year--you won't have any decimal artifacts in the year field.

EDIT: And now compare it with compound interest--by 2026, that $24 would have turned into $7,176,800,429.97.
 
Last edited:

Similar threads

Replies
9
Views
2K
Replies
6
Views
2K
Replies
8
Views
2K
Replies
1
Views
4K
Replies
19
Views
4K
Replies
1
Views
15K
Back
Top