Question: ( PYTHON ) Lab 3 A: Credit Cards. Financial advisors will almost always tell you that you should pay for things in cash and avoid

(PYTHON) Lab3A: Credit Cards. Financial advisors will almost always tell you that you should pay for things in cash and avoid credit card debt. Further, they tell you that you should have a small emergency fund that you keep stocked for emergencies like flat tires, dead refrigerators and so on. However, life doesnt always work that way and sometimes we need to charge things to our credit cards. So, for this part of the lab, were going to write a calculator that calculates your minimum monthly payment on your card.
To create this calculator, we will ask the user for the current balance on their credit card and the APR (Annual Percentage Rate) of the card. To calculate the minimum payment, you will multiply the current balance on the credit card (also called the amount owed) times APR and divide this number by 12 since there are 12 months in a year. The formula is:
Amount Owed \times APR -: 12= Minimum Payment.
The input APR is a percentage, so be sure to divide it by 100 when calculating the minimum payment. The Monthly Percentage Rate is calculated by dividing the APR by 12 since there are 12 months in a year. When printing the monthly percentage rate and the minimum payment, make sure to round them to 3 and 2 decimal places, respectively. You can round any float by putting it inside round():
print(round(3.14159,2)) #prints PI rounded to two decimal places
Below are two example runs. The user input is in bold (notice the dollar sign is not part of the user input).
Sample run 1: Amount owed: $2000 APR: 19.75 Monthly percentage rate: 1.646 Minimum payment: $32.92
Sample run 2: Amount owed: $8500 APR: 29 Monthly percentage rate: 2.417 Minimum payment: $205.42
I am needing to code this in Python. Here is my solution so far:
owed = float(input("Amount owed: $"))
APR = float(input("APR: "))
APR_percentage = APR/100
monthly_APR = APR_percentage
min_payment = owed*APR_percentage/12
rounded_monthly_percentage = round(monthly_APR, 3)
rounded_min_payment = round(min_payment, 2)
print("Monthly percentage rate: "+ str(rounded_monthly_percentage))
print("Minimum payment: $"+ str(rounded_min_payment))
I can get the minimum payment calculator correct, but I can't seem to get correct the Monthly Percetage Rate. What am I missing or doing incorrectly for that?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!