Preface: How to Use the Instructor’s Manual CS225 Fundamentals of Computer Science XXXXXXXXXXCourse Syllabus Fall 2013 Dr. Simon Lin XXXXXXXXXXVersion: 09/02/2013 CS119 Python Programming...

1 answer below »
attached file


Preface: How to Use the Instructor’s Manual CS225 Fundamentals of Computer Science Course Syllabus Fall 2013 Dr. Simon Lin Version: 09/02/2013 CS119 Python Programming Project Assignment 9 (PJ 9) Dr. Lin Version 1/11/21 PJ 9 – Loan Payment Report Please write a Python program to generate a professional loan payment report from the first month until the loan balance becomes zero or less than ten cents. Your program will not request any input from the user. Your program will set those values (for loan amount, annual interest rate, and monthly payment) accordingly to generate each report for each test case. You have just purchased a stereo system that cost $1000.00 on the following loan plan (as test case #1): There is no down payment for this loan. The annual simple interest rate is 18.0% (and hence 1.5% per month or 0.015 per month). The monthly payment amount is $50.00. The monthly payment of $50.00 is used to pay the interest and whatever is left is used to pay part of the remaining debt. Therefore, the first month you need to pay 1.5% of $1000 as interest, which is $15.00. So, the remaining $35.00 (=$50.00 -$15.00) is deducted from your loan balance, which leaves you with a debt of $965.00 (=$1000.00 - $35.00). The next month, you need to pay 1.5% of $965 as interest, which is $14.48. Hence, you can deduct $35.52 (=$50.00 - $14.48) from your loan balance for this month. Then, you continue to pay for next month and so on until the loan balance is less than the monthly payment amount. You may use a while loop such as: while (loanBalance >= monthPayment) When the loan balance is less than the monthly payment, you must exit the while loop so that you can compute the final payment amount, which should be the loan balance plus its monthly interest. For example, if your last-month’s loan balance is $47.12, which is less than the monthly payment of $50.00, then its final payment should be $47.83 because $47.12 plus its monthly interest $0.71 (= 47.12 * 0.015) is $47.83. Please make sure that your report is very user-friendly and very professional. Your program does not request any input from the user for the monthly payment amount. You can simply change the monthly payment amount in your program from one run to another for each test case. You may use the following statement to print those five values with proper alignments for each column. The formatting control is required to show only two digits after the decimal point for each value. print ("%-2d" % month + " $%0.2f" % monthPay + " $%0.2f" % interest + " $%0.2f" % debtPaid + " $%0.2f" % loanBalance ) ==========================================================================. Your report must first show the following headline: (for example of test case #1) Loan amount: $1000.0 Annual Interest Rate: 18.0%Monthly Payment: $50.0 Your report must then show the following five columns for each month’s payment until the loan balance is equal to 0 or less than 0.10: Month # # Start from 1 for first month, 2 for second month, and so on Month-Payment # Same for every month until the very last payment to pay off the loan balance Interest-Paid # current-Loan-Balance * Monthly-Interest-Rate Debt-Paid # Monthly-Payment – Interest-Paid Loan-Balance # Last-Month-Loan-Balance – Debt-Paid Your report must have the following line at the end to show the total interest amount being paid. Therefore, you need to create a variable (such as totalInterest) to accumulate all the interest payments while you are in the loop computing the detail of each month. Total Amount of Interest Paid: $______________ ==========================================================================. You must run the following 3 test cases exactly for this assignment. Your test case #1 is: Loan amount: $1000.0 Annual Interest Rate: 18.0%Monthly Payment: $50.0 Your test case #2 is: Loan amount: $1000.0 Annual Interest Rate: 18.0%Monthly Payment: $100.0 Your test case #3 is: Loan amount: $1000.0 Annual Interest Rate: 18.0%Monthly Payment: $180.0 Each test case or test run must begin with a welcome message, and must end with a thank-you message. =========================================================================. The output of your test case #1 must look exactly as follows including the data: Welcome to the Loan Payment Report of "Dr. Simon Lin" ! must use your name! 1==================================================================. Loan amount: $1000.0 Annual Interest Rate: 18.0%Monthly Payment: $50.0 Month#Month-Payment Interest-Paid Debt-Paid Loan-Balance ----------------------------- -------------------- ----------------------- ------------------ 1$50.00$15.00$35.00$965.00 2$50.00$14.47$35.52$929.48 3 $50.00 $13.94 $36.06 $893.42 . . . 21 $50.00$2.86 $47.14 $143.53 22$50.00$2.15 $47.85 $95.68 23$50.00$1.44 $48.56 $47.12 24$47.83$0.71 $47.12 $0.00 Total Amount of Interest Paid: $197.83 2==================================================================. Thank you for using the Loan Payment Report of "Dr. Simon Lin"! must use your name! 3==================================================================. How to submit your Project Assignment (PJ)? (1) Each program must be well documented with block comments and proper line comments. The beginning of each program must have a block comment to show its author, date, and purpose. The following is an example of block comments: # Author: _______________ must use your full name here! # Date: _________ must put today’s date here! # Purpose: _______________ must show the purpose of this program here! (2) You must submit to Canvas the following two items as attachments: (a) Your source program (for example, CS119-PJ9.py ), and (b) Your WORD document (for example, CS119-PJ9-report .docx ) containing the listing of your Python program, and the complete output of your 3 test runs as specified. You must not submit a zip file to Canvas. =========================================================================. // Please delete everything above this line to make this your Word document to be submitted. PJ 9 Report My Name: ______________ A. The following is my Python source program: // Please copy your source program into here from your Visual Studio IDE. // Your code here must be in color. You should not show screen prints here. B. The following is the console output of my 3 test runs: // One way to copy the console output is to press Ctrl+Alt+PrtScn. // Another way to copy is to use the snipping tool. To paste the image is to press Ctrl+v. // Please make sure your console is long enough to show all your output lines to be captured. // Please copy your console output and paste into here: Your test case #1: Loan amount: $1000.00 Annual Interest Rate: 18.00%Monthly Payment: $50.00 Your test case #2: Loan amount: $1000.00 Annual Interest Rate: 18.00%Monthly Payment: $100.00 Your test case #3: Loan amount: $1000.00 Annual Interest Rate: 18.00%Monthly Payment: $180.00 Page 1 of 1 Page 2 of 3
Answered Same DayFeb 06, 2021

Answer To: Preface: How to Use the Instructor’s Manual CS225 Fundamentals of Computer Science XXXXXXXXXXCourse...

Neha answered on Feb 06 2021
155 Votes
75428 - loan payment/code.py
print("Welcome to the Loan Payment Report of Melanie Benitez!")
print
("=======================================================")
loanAmount = 1000.0
rate = 18.0
monthlyPayment = 180.0
print("Loan Amount: $",loanAmount," Annual Interest Rate: ",rate,"% Monthly Payment: $",monthlyPayment)
print("Month MonthlyPayment Interest-Paid Debt-Paid Loan-Balance")
print("----- -------------- ------------- --------- ------------")
month = 0
totalInterest = 0.0
while True:
month = month+1
monthlyrate = (rate/12)/100
interestpaid = loanAmount * monthlyrate
debtpaid = monthlyPayment - interestpaid
loanbalance = loanAmount - debtpaid
totalInterest = totalInterest + interestpaid
print ("%-2d" % month + " $%0.2f" % monthlyPayment + " $%0.2f" % interestpaid+ " $%0.2f" % debtpaid + " $%0.2f" % loanbalance)
loanAmount = loanAmount - debtpaid
...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here