Question: Asking Python Imagine that you get paid on the 1st and 15th of the month. After looking at your budget, you feel you could spend

 Asking Python Imagine that you get paid on the 1st and15th of the month. After looking at your budget, you feel youcould spend $200 a paycheck and you are thinking of buying acar. You know the interest rate will be 4.74%. You figure the

Asking Python Imagine that you get paid on the 1st and 15th of the month. After looking at your budget, you feel you could spend $200 a paycheck and you are thinking of buying a car. You know the interest rate will be 4.74%. You figure the car loan will be spread over 4 years, paying 2 payments per month (24 a year). The care you are looking at is $20,000. Can you afford it? There is a financial formula out there you could use. PV + FV PV + (1+ip)-1 k With this formula, you would need to understand what the variables are. PMT = Payment per period PV Present Value you are borrowing FV = Future Value you want (which is likely 0!) = Number of Payments a year (24 ... twice a month) ip = interest rate (4.74%) per period k 1 if payment is made at the end of the period (Trust me... it's a financial thing) N = Let's use Python's shell to see if we can afford the car? Here I am using the interpreter and commands. Python 3.9.1 (tags/v3.9.1:1e5d33e, Dec 7 2020, 17:08:21) [MSC v.1927 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license ()" for more information. >>> PV= 20000 >>> i = 4.74 >>> NumYrs = 4 >>> Pmt PerYear = 24 #2 payments per month >>> FV = 0 # Future Value of loan is $o. (You want this paid off, right?) >>> -1 # (payment is at end of period it's a finance thing!) >>> ## Now ... off to calculate payment. This will look messy. >>> numerator = PV + FV >>> ip = i/100/Pmt PerYear >>> NumPmts = NumYrs * Pmt PerYear >>> denominator = (1 + ip) **NumPmts - 1 >>> fraction = numerator/denominator >>> other_fraction = (-1 * ip/k) >>> Payment = PV + fraction >>> Payment = Payment * other_fraction >>> Payment -228.91210686170604 So, the payments would be $-228.91, twice a month! Why negative? Because you are paying DOWN a loan. If you were INVESTING, it would be positive. But, to take the guess work out, why don't we just put the payment into a FUNCTION that gives us the "Absolute Value (always positive) and then print it out, using a format function! >>> abs (Payment) 228.91210686170604 >>> print (E"Your payment would be ${abs (Payment):,.2f} a period") Your payment would be $228.91 a period So, how much did you totally spend on your car? (The number of payments multiplied by the payments) >>> totalCost = abs (Payment) * NumPmts >>> print (f"Your Total Cost of the car would be ${totalCost:,.2)") Your Total Cost of the car would be $21,975.56 How much interest? (What is the cost of borrowing??) >>> costofBorrowing = totalCost PV >>> print (f"The cost of borrowing would be ${costOfBorrowing:,.2)") The cost of borrowing would be $1,975.56 Now you know how to calculate the payment, total cost of the loan and the total amount of interest, please do the following. Create a flowchart of a program that calculates the payment, total cost and cost of borrowing of a loan. (10 points) No tricks. Just take the lines from the above dialogue and make it into a flowchart. It would be similar to this... Start ilo Principle? i/p Rate? i/p Number ip Periods Calculate Amount print Amount End Create a program that calculates the payment, total cost and cost of borrowing of a loan. (20 points) Again, no tricks. You have ALL THE CODE you need in my example. Make it a program and then run it with the following prompts and values. = RESTART: C:/Users/gijrs/AppData/local/Programs/Python/Python39/calcPayment.py What is your total of the loan? 20000 What is your interest? 4.74% would be entered in as 4.74 4.74 How many years? 4 How many payments per year? 24 Your payment would be $228.91 a period Your Total Cost of the car would be $21,975.56 The cost of borrowing would be $1,975.56 Copy and paste your code below and a screenshot of the run

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 Databases Questions!