Assume you start with $100 in a saving account that earns 12% per year. The monthly interest rate is 12%/12 = .12/12 = .01. After the first month there is 100 + (.01)*100 in the account = 101

After the second month there is:

101 + (.01)* (101) = 102.01

Thus each month is adding .01 times previous month to previous month value as new saving value.

Write a program that reads in initial saving value (make it $100) and reads in interest rate (make it .12) per year and then figures out how much will be in the account after 4 months.

read amount

read rate
mrate = rate/12.0

bal = amount * (1+mrate)^4
that last expression might vary, depending on the language:
(1+mrate)**4
pow(1+mrate,4)

To write a program that calculates the amount in the savings account after 4 months, you can use a loop to calculate the interest and update the balance each month.

Here's an example program in Python that accomplishes this:

```python
def calculate_savings(initial_balance, interest_rate, months):
balance = initial_balance
monthly_interest_rate = interest_rate / 12

for _ in range(months):
interest = balance * monthly_interest_rate
balance += interest

return balance

initial_balance = 100
interest_rate = 0.12
months = 4

final_balance = calculate_savings(initial_balance, interest_rate, months)
print("After {} months, the final balance will be ${:.2f}".format(months, final_balance))
```

In this program, the `calculate_savings` function takes three arguments: `initial_balance` (the starting amount in the savings account), `interest_rate` (the yearly interest rate), and `months` (the number of months to calculate).

The function initializes the `balance` variable to the `initial_balance` value. Then, it calculates the monthly interest rate by dividing the `interest_rate` by 12.

Next, a loop is used to calculate the interest and update the balance each month. The loop runs `months` times, accumulating the interest on the current balance and adding it to the balance.

Finally, the function returns the final balance.

In the main part of the program, we set the `initial_balance`, `interest_rate`, and `months` variables to their respective values. Then, we call the `calculate_savings` function with these values, storing the result in the `final_balance` variable. Finally, we print the final balance using string formatting to include the number of months and format the balance as a decimal with two decimal places.