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.

#include <stdio.h>

#include <math.h>
int main()
{
float balance; //Número
float epsilon = 0.001; //Exactitud buscada
float AIR;//annual Interest rate
float MMP=10;//minimum montly payment
float mub;//montly unpaid balance
float mir;// montly interest rate
int i=1;

/*printf("Balance: ");scanf("%d",&balance);//pedimos el balance
printf("Annual Interest Rate: "); scanf("%d",&AIR); //pedimos el annual interest rate

while ((MMP*12)-balance>=epsilon && (MMP*12)<=balance)
{
while(i<12)
{
mir=AIR/12.0;// sacamos el montly interest rate
mub=balance-MMP;//el balance disminuye conforme lo que se paga
balance= mub + (mir*mub);//cambiamos el valor del balance al sumarle interes
i+=1;//aumentamos el contador a 1
}
MMP+=10;
}*/

printf("Lowest payment %f", MMP);

return 0;
}

To calculate the minimum fixed monthly payment needed to pay off a credit card balance within 12 months, you can use the following steps:

1. Initialize the variables `balance` and `annualInterestRate` with the given values.
2. Set the initial value of the monthly payment `monthlyPayment` to a multiple of $10, such as $10.
3. While the balance is positive:
a. For each month in the range 1 to 12:
i. Calculate the unpaid balance before making the monthly payment as `monthlyUnpaidBalance = balance - monthlyPayment`.
ii. Calculate the updated balance after including the interest as `balance = monthlyUnpaidBalance + (monthlyInterestRate * monthlyUnpaidBalance)`.
b. If the final balance is greater than 0, increase the monthly payment by $10 and reset the balance to the initial value.
4. Once the loop is finished and the balance reaches 0, print the final monthly payment.

Here is the Python code that implements the above steps:

```python
# Step 1
balance = # input value
annualInterestRate = # input value

# Step 2
monthlyPayment = 10

# Step 3
monthlyInterestRate = annualInterestRate / 12.0

while balance > 0:
# Step 3a
for month in range(1, 13):
# Step 3a i
monthlyUnpaidBalance = balance - monthlyPayment
# Step 3a ii
balance = monthlyUnpaidBalance + (monthlyInterestRate * monthlyUnpaidBalance)

# Step 3b
if balance > 0:
monthlyPayment += 10
balance = # reset balance to initial value

# Step 4
print("Lowest Payment:", monthlyPayment)
```

Make sure to replace the `# input value` and `# reset balance to initial value` placeholders with the actual values provided as input.

To solve this problem, we can use a simple iterative approach. We'll start with a minimum monthly payment of $10 and keep increasing it until we find the lowest payment that will pay off all the debt within 12 months.

Here's the code to calculate the lowest monthly payment:

```
# Set initial values for balance and annual interest rate
balance = 3926
annualInterestRate = 0.2

# Initialize variables for calculation
monthly_interest_rate = annualInterestRate / 12
monthly_payment = 10

# Keep iterating until debt is paid off in 12 months
while True:
# Reset balance at the beginning of each iteration
temp_balance = balance

# Calculate balance at the end of 12 months
for i in range(12):
unpaid_balance = temp_balance - monthly_payment
temp_balance = unpaid_balance + (monthly_interest_rate * unpaid_balance)

# Check if balance is paid off within 12 months
if temp_balance <= 0:
break

# Increment monthly payment by $10 for the next iteration
monthly_payment += 10

# Print the lowest monthly payment
print("Lowest Payment:", monthly_payment)
```

Simply replace the initial values of `balance` and `annualInterestRate` with your desired values before running the code.