Using Python, write an application that will calculate a loan payment. To complete this, you are required to write 2 functions, LoanPayment and InterestOnlyLoanPayment, as well as a test application that calls each of the functions to get the payment amount based on parameters supplied to the functions. The test application should output both the loan payment and the interest-only loan payment based on input values from the user.
The LoanPayment function is defined as follows:
Payment = Loan amount / Discount factor
The discount factor is {[(1 + i)^n] - 1} / [i(1 + i)^n], where you have the following:
- n = Payments per year × Number of years
- i = Annual interest rate / Payments per year
Take for example the following:
D = {[(1 + 0.005)^360] – 1} / [0.005(1 + 0.005)^360] = 166.7916, where n = 12 × 30 and i = 0.06 / 12.
Loan payment = $250,000 / 166.7916 = $1,498.88
The InterestOnlyLoanPayment is defined as follows:
Interest-only payment = Loan amount × (Annual interest rate / 12)
Take for example the following:
Interest-only payment = $250,000 × (0.06 / 12) = $1,250
The test application interaction should be something like the following:
- Enter loan amount: $250,000
- Enter duration of loan: 30
- Enter interest rate: 6
- Interest only payment: $1,250
- Principle or interest payment: $1,498.88
Trending nowThis is a popular solution!
Step by stepSolved in 3 steps with 2 images
- in c++pls i am doing it on replitarrow_forwardCorrect and detailed answer will be Upvoted else downvoted. Also Explain why other options are FALSE. Thank you!arrow_forwardPlease tapy answer def question14(otherFunction): '''The parameter provided is a function. You will call this function by writing: otherFunction() Do the following: - if the result of calling otherFunction() is an int then return the negative of that value e.g. if otherFunction() returns 7 then this function should return -7 - if the result of calling otherFunction() is some other value then return the result of concatenating 'meh' and that value e.g. if otherFunction() returns 3.2 then this function should return 'meh3.2' e.g. if otherFunction() returns None then this function should return 'mehNone' - if the result of calling otherFunction() is an error then return 'uh-oh' (exactly the way I have it spelled here) ''' passarrow_forward
- Program Functions With No Parameters But With Return Values Create a function named askInput that asks the user an integer input if called. The function will return the input. In the main function, call the askInput function and store the returned value in an integer variable then print it in a newline. Input 1. One line containing an integer Output Enter a number: 10 10arrow_forwardIn python, write a function that receives three parameters: name, weight, and height. The default value for name is James. The function calculates the BMI and returns it. BMI is: weight/(height^2). Weight should be in kg and height should be in meters. For instance, if the weight is 60 kg and the height is 1.7 m, then the BMI should be 20.76. The function should print the name and BMI. The function should return 'BMI is greater than 22' if the MBI is greater than or equal to 22. Otherwise, the function should return 'BMI is less than 22'. Call the function and print its output.arrow_forwardCode is in Pythonarrow_forward
- Write a program that calculates the balance of a checking account at the end of a three- month period. It should ask the user for the starting balance. Then a loop (for loop is recommended) should iterate once for every month in the period, performing the followi 1. Ask the user for the total amount deposited into the account during that month. Do n accept negative number. This deposit should be added to the current balance to make current balance is up to date. 2. Ask the user for the total amount withdrawn from the account during that month. Do accept negative amount or amount greater than the current balance. The withdrawal amount should be subtracted from current balance, so current balance is up to date. 3. Update the total deposit. 4. Update the total withdrawal After the last iteration, the program should display the following information: 1. starting balance at the beginning of the three-month 2. total deposits/withdrawals made during the three-month period 3. final balance…arrow_forwardIbra Bakery wants you to create a simple python program for calculating cashback offers on cakes for the customers on the occasion of their second anniversary. The program should start by reading customer_name, Number_of_cakes. Then you need to do the following Create a void function and a parameter that will display “Welcome to Ibra bakery <customer name>”. example: Welcome to Ibra bakery Mohammed Create a function with return value and with a parameter Number_of_cakes. then input cake_price of each cake. Then calculate Total_price as sum of all the cakes’ prices. Create a function that will accept Total_price as parameter then compute cashback based on a criterion that if Total_price is more than 10.0 omr, cashback will be 20% of Total_price otherwise no cashback. Display all the details as output. User-defined function (python)arrow_forwardWhat benefits can you get from using a function?arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education