找回密码
 立即注册

扫一扫,访问微社区

QQ登录

只需一步,快速开始

查看: 6415|回复: 0

求python大神解答一下这道题

1

主题

1

帖子

0

积分

贫民

积分
0
lhhlyh 发表于 2013-11-22 10:29:19 | 显示全部楼层 |阅读模式
You are to create a program in a graphics window that allows a user to charter/rent a yacht (see 1st example). They will enter their name, enter the yacht type, size of the yacht and number of hours. Each size has an hourly rate associated with it. There will be a list of yachts available to choose from on the form. The number of hours they enter may not be whole hours.
There is a display of Yacht types on the form. Those yacht types are stored in a list. When the program starts you will need to import a filethat has the 3 yachts and then place them into a list.  Then take the items of the list and display them on the form. When the user enters a new yacht type and clicks on the Add Yacht button you will need to add that yacht type to the list that stores the yacht types and then reset the display on the form(see 2nd example). No need to update the file.
The user will enter the size of the yacht (listed also on the form).The user will then enter the number of hours they will charter the boat. At this point they will click on the Total button. If there are no errors you will display the Subtotal, Tax (8.5%), Total and message (see 3rd example). If there are any errors - textboxes not filled out, or text when you are expecting numbers - you are to display error message(s) and place a red asterisk next to the offending textboxes(see 4th example). Another error would be if the user put in a Size different than listed on the form.
The restriction of the program (to make it easier for you) is that the user will enter the information, then they may or may not click the Add Yacht button. After that they will click the Total Button. If everything is fine you will display the totals and message, if there are any errors you will display the error message(s). The program will be over at that point. The user will not go back up and fill out the correct information after they get an error message, nor will they be able to reenter information if all goes well.


file:///c:/users/lenovo/appdata/roaming/360se6/User Data/Temp/preview?.png
1.png
2.png
3.png
4.png
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表