Now write a program that calculates the minimum fixed monthly payment needed in order pay off a credit card balance within 12 months. By a fixed monthly payment, we mean a single number which does not change each month, but instead is a constant amount that will be paid each month.

In this problem, we will not be dealing with a minimum monthly payment rate.

The following variables contain values as described below:

balance - the outstanding balance on the credit card

annualInterestRate - annual interest rate as a decimal

The program should print out one line: the lowest monthly payment that will pay off all debt in under 1 year, for example:

Lowest Payment: 180
Assume that the interest is compounded monthly according to the balance at the end of the month (after the payment for that month is made). The monthly payment must be a multiple of $10 and is the same for all months. Notice that it is possible for the balance to become negative using this payment scheme, which is okay. A summary of the required math is found below:

Monthly interest rate = (Annual interest rate) / 12.0
Monthly unpaid balance = (Previous balance) - (Minimum monthly payment)
Updated balance each month = (Monthly unpaid balance) + (Monthly interest rate x Monthly unpaid balance)

Test Cases to Test Your Code With. Be sure to test these on your own machine - and that you get the same output! - before running your code on this webpage!
Click to See Problem 2 Test Cases

The code you paste into the following box should not specify the values for the variables balance or annualInterestRate - our test code will define those values before testing your submission.

looks suspiciously similar to edX question due Sunday...

To solve this problem, you can use an iterative approach to find the minimum fixed monthly payment needed to pay off the credit card balance within 12 months.

Here's an explanation of the steps you can follow in your program:

1. Create a variable named "monthlyPayment" and set its initial value to $10 (since the monthly payment must be a multiple of $10).

2. Use a while loop to iterate until the balance is paid off within 12 months. Initialize another variable, "remainingBalance", with the initial balance.

while remainingBalance > 0:
Set remainingBalance equal to the initial balance

3. Within the loop, calculate the remaining balance after 12 months using the monthly payment.

for month in range(12):
Calculate the monthly interest rate using the formula (annualInterestRate / 12.0)
Calculate the monthly unpaid balance using the formula (remainingBalance - monthlyPayment)
Update the remaining balance for the next month using the formula (unpaidBalance + (monthlyInterestRate * unpaidBalance))

4. After the loop, check if the remaining balance is zero or less.

if remainingBalance <= 0:
The monthly payment is enough to pay off the balance within 12 months.
Print "Lowest Payment: " followed by the value of monthlyPayment.
else:
The monthly payment is not enough to pay off the balance within 12 months.
Increment monthlyPayment by $10 and repeat the process starting from step 2.

Here's an example implementation in Python:

```python
balance = # define the initial balance
annualInterestRate = # define the annual interest rate

monthlyPayment = 10
remainingBalance = balance

while remainingBalance > 0:
remainingBalance = balance

for month in range(12):
monthlyInterestRate = annualInterestRate / 12.0
monthlyUnpaidBalance = remainingBalance - monthlyPayment
remainingBalance = monthlyUnpaidBalance + (monthlyInterestRate * monthlyUnpaidBalance)

if remainingBalance <= 0:
break

monthlyPayment += 10

print("Lowest Payment:", monthlyPayment)
```

Remember to replace the placeholders with the actual values for balance and annualInterestRate in your own program.