According to legend, the island of Manhattan was purchased from its Native American population in 1626 for $24. Assuming that this money was invested in a Dutch

bank paying 5 percent simple interest per year, construct a table showing how much
money the Indians would have at the end of each twenty year period, starting in
1626 and ending in 2013.
how do you write that with nested loops

To solve this problem using nested loops, we can follow these steps:

1. Initialize the initial amount of money ($24) and the interest rate (5%) as variables.
2. Use nested loops to iterate through each twenty-year period, starting from 1626 and ending in 2013.
3. For each year within a twenty-year period, calculate the interest earned and add it to the initial amount of money.
4. Print the year and the total amount of money at the end of each twenty year period.

Here's an example implementation in Python:

```python
initial_amount = 24
interest_rate = 0.05

# Loop over each twenty-year period starting from 1626 and ending in 2013
for year in range(1626, 2014, 20):
total_amount = initial_amount
for _ in range(20):
interest_earned = total_amount * interest_rate
total_amount += interest_earned
print(f"Year: {year}, Total amount: ${total_amount:.2f}")
```

This code will output a table showing the total amount of money at the end of each twenty-year period starting from 1626 and ending in 2013. The interest earned on the initial amount is calculated at each year within a twenty-year period. The total amount is then updated by adding the interest earned.

To construct a table showing how much money the Native Americans would have at the end of each twenty-year period, starting in 1626 and ending in 2013, with a 5 percent simple interest per year, you can use nested loops in a programming language such as Python. Here's an example of how you can write this using nested loops in Python:

```python
principal = 24
interest_rate = 0.05
current_year = 1626
end_year = 2013

print("Year\tAmount")

while current_year <= end_year:
amount = principal
for _ in range(20):
amount += amount * interest_rate
print(f"{current_year}\t{round(amount, 2)}")
current_year += 20
```

This code initializes the principal amount to $24, the interest rate to 5%, and sets the current year to 1626 and the end year to 2013. Then, it prints a header for the table.

The code then enters a while loop that continues until the current year exceeds the end year. Inside the while loop, a for loop is used to calculate the amount of money the Native Americans would have at the end of each twenty-year period. The amount is updated by adding the interest earned based on the previous amount.

Finally, the current year and the calculated amount are printed in each iteration, and the current year is incremented by 20 years. The round() function is used to round the amount to two decimal places for readability.

By executing this code, you will get a table showing the year and the amount of money the Native Americans would have at the end of each twenty-year period.