本人学渣一枚,去年9月份达到美国以后,学习了半年英语,这学期通过了校内的考试,正式可以选择专业课了,于是特意选了一门计算机的入门课学习,以后此贴会分享给大家一些学习上的东西
这周的作业。。 CSC 110
Loan Calculator
You've been hired to do some programming for Metro Bank. They want you to create a program to calculate loan payments. The user will enter the amount of money to borrow from the bank, the annual interest rate percentage (that will be compounded monthly) and the number of years to pay back the loan. The program will then display the monthly payment and the total amount of interest that will be paid. Also, to be more helpful to the user, display these same results using a loan amount of 10% more and 10% less. Objectives
writing your own functions with parameters and return values gaining more experience working with calculations User Interface Specifications
The program should start with a basic introduction for the user (remember, this is different from the comment at the top of the file). Prompt the user for 3 pieces of input: amount of loan in dollars, length of loan (in years), and annual interest rate. Make sure that the prompt clearly tells the user what to input and the units for each input. For the interest rate, the user enters an annual percentage rate, such as 5 for 5%, not the decimal 0.05.
When displaying the results, first redisplay the original input. Then, display the monthly payment and the total interest (see formulas below). Also calculate and display these results using a loan amount of +10% and -10% to give the user a range of results. Make sure that any dollar amount is displayed with exactly 2 decimal spaces. All displayed values need to be properly labeled.