Peter decided to save money to buy a house. Enter this amount as well as the amount he will be able to save each month. He earns 0.8% interest per month while the amount is less than R70,000 and 0,7% interest per month if the amount is equal to or more that R70,000. The interest is added to the total amount. Calculate how many months he will have to save before he has reached his goal. Display the final amount and the number of months.

To solve this problem, we will use a loop to simulate Peter's savings over time. Here is the step-by-step process:

1. Prompt the user to enter the target amount for buying a house (let's call it 'target_amount') and the monthly savings amount (let's call it 'monthly_savings').

2. Initialize the variables 'current_amount' to 0, 'interest_rate' to 0.8%, 'months' to 0.

3. Start a loop that continues until the 'current_amount' is greater than or equal to the 'target_amount'.

4. Inside the loop, check if the 'current_amount' is less than R70,000. If so, set the 'interest_rate' to 0.8%. Otherwise, set the 'interest_rate' to 0.7%.

5. Calculate the interest earned in a month by multiplying the 'current_amount' by the 'interest_rate' divided by 100.

6. Calculate the new 'current_amount' by adding the 'monthly_savings' to the 'current_amount' and adding the interest earned.

7. Increment 'months' by 1.

8. Repeat steps 4 to 7 until the 'current_amount' is greater than or equal to the 'target_amount'.

9. Display the final 'current_amount' and the 'months' it took to reach the target.

Here is an example implementation in Python:

```python
target_amount = float(input("Enter the target amount to buy a house: R"))
monthly_savings = float(input("Enter the monthly savings amount: R"))

current_amount = 0
interest_rate = 0.8
months = 0

while current_amount < target_amount:
if current_amount >= 70000:
interest_rate = 0.7

interest_earned = current_amount * (interest_rate / 100)
current_amount += monthly_savings + interest_earned
months += 1

print(f"The final amount is R{current_amount:.2f}")
print(f"It took {months} months to reach the target.")
```

This code will calculate the number of months needed to save enough money to reach the target amount for buying a house. It takes into account the different interest rates based on the current savings amount.