分享北美学习python的点点滴滴

andysunx 发布于 2016年04月20日 | 更新于 2016年04月26日
无人欣赏。 1人反对。

本人学渣一枚,去年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.

共5条回复
云的彼端 回复于 2016年04月20日

继续啊,看看你的后续故事

heiqimingren 回复于 2016年04月21日

加油,我也在学习python3.5.不过是在国内哈

hawkcn_zhang 回复于 2016年04月25日

加油! by 2016-4-25

andysunx 回复于 2016年04月26日

1楼 @云的彼端 更新了

2楼 @heiqimingren 哈哈哈,加油

3楼 @hawkcn_zhang 加油

feifei 回复于 2016年04月26日

加油,楼主.期待更新

登录 或者 注册
相关帖子