基本 Python 函数和常量帮助
我不知道从哪里开始这项作业:
在购买新房时,您必须考虑几个因素。在这个问题中,房屋的初始成本、估计的年度燃料成本和年税率都是可用的。编写一个程序,确定并显示五年后房屋的总成本,并针对以下每组数据执行该程序:
Initial House Cost Annual Fuel Cost Tax Rate
167,000 3,300 0.025
162,000 3,500 0.025
175,000 2,850 0.025
要计算房屋成本,请将初始成本添加到五年的燃料成本中,然后加上五年的税款。一年的税款是用税率乘以初始成本来计算的。显示实验室和讲座中讨论的程序测试。
任何有关编写初始函数和常量的帮助将不胜感激!
I'm not sure where to even start this assignment:
In shopping for a new house, you must consider several factors. In this problem the initial cost of the house, the estimated annual fuel costs, and the annual tax rate are available. Write a program that determines and displays the total cost of a house after a five-year period and execute the program for each of the following sets of data:
Initial House Cost Annual Fuel Cost Tax Rate
167,000 3,300 0.025
162,000 3,500 0.025
175,000 2,850 0.025
To calculate the house cost, add the initial cost to the fuel cost for five years, then add the taxes for five years. Taxes for one year are computed by multiplying the tax rate by the initial cost. Show testing for your program as discussed in lab and lecture.
Any help with writing the initial function and the constants would be greatly appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要计算房屋成本,请将初始成本添加
到五年的燃料成本中,
然后添加五年的税金。一年的税款是用税率乘以初始成本来计算的。
To calculate the house cost, add the initial cost
to the fuel cost for five years,
then add the taxes for five years. Taxes for one year are computed by multiplying the tax rate by the initial cost.
您应该首先阅读 python.org 上的基础知识。
然后,您只需对每个数据集执行
T=A+B*5+A*C*5
即可。最后查阅您的实验和讲义,了解如何展示测试。
You should start by reading the basics at python.org.
Then you just do
T=A+B*5+A*C*5
for each of your data sets.Finally consult your lab and lecture notes to see how to show testing.