永发信息网

又一道编程题 会的看下!

答案:1  悬赏:0  手机版
解决时间 2021-05-06 12:26

Write a program that can be used by a cinema to sell tickets for movies. The cinema has 2 auditoriums of different sizes; the one has 15 rows of seats, with 30 seats in each row, inclusive of 1 executive row at the back which seats couples. The other has 10 rows of seats, with 20 seats in each row. The program should display a screen that shows which seats are available and which are taken. For example, the following screen shows a chart depicting each seat in the cinema. Seats that are taken are represented by an * symbol, and seats that are available are represented by a # symbol:

Seats

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20

Row 1 * * * # # # * * * * * * * # # # # * * #

Row 2 # # # # # # # # * * * * # # # # * * * *

:

Row 10# # # # # # # # # # # # # # # # # # # #

Here is a list of tasks this program must perform:

· When the program begins, it should ask the user to enter their name, the choice of auditorium, then the seat prices for each row. The prices can be stored in a separate array. (Alternatively, the prices may be read from a file.) Assume seat prices of each auditorium and each row is different.

· Once the prices are entered, the program should display a seating chart similar to the one shown above. The user may enter the number of tickets, the row and seat number for tickets being sold. Every time a ticket or group of tickets is purchased, the program should display the total ticket prices and update the seating chart. If a user purchased more than 10 tickets, then a 5% discount of the total amount is given. Your program should be smart enough to tell users whether seats purchased has someone else seated next to them (either left or right) or seated at their back or at the front.

· The program should keep a total of all ticket sales. The user should be given an option of viewing this amount.

· The program should also give the user an option to see a list of how many seats have been sold, how many seats are available in each row, and how many seats are available in both auditorium.

Input validation: When tickets are being sold, do not accept row or seat numbers that do not exist. When someone requests a particular seat, the program should make sure that seat is available before it is sold. Executive row must be sold as couple seat (2 seats)

最佳答案
  写一个程序,可以用它来出售门票电影院看电影。电影院有2个不同规格的会议室,有15一排排座位,30个席位,包括在每一行的背面,执行排座位的夫妇。另一个有10个一排排座位,每一行20个座位。这个计划应该显示屏幕上显示的座位都是可行的,都具有十分重要的现实意义。例如,下面的屏幕显示一个图表描述每个座位在电影院。座位是采取一个*符号、座位,可由一个#符号。
  
  座位
  
  1二3四5六7 8尖利十二13十四15 16 17十八19 20
  
  1 # # #的* * * * * * * * * * # # # # * * #
  
  2 # # # #的连续# # # # * * * * # # # # * * * *
  
  :
  
  10 # # # #的连续# # # # # # # # # # # # # # # #
  
  这里有一些任务,这个计划必须执行。
  
  什么时候开始,它应该计划要求用户输入他们的名字,选择不同的礼堂,那么这个座位的价格为每一行。这个价格可以被存储在一个独立的数组。(另外,价格会阅读文件。)每个大礼堂坐价格假定,每一行都是不同的。
  
  一旦价格进入·,程序显示一个座位图表类似以上。用户可以输入票,行和座位号门票售出。每次一票或一组票购买时,这个程序应该显示总票价和更新座位的图表。如果用户购买十多张票5%的折扣,然后给出的总量。你的程序应该足够聪明能告诉用户是否拥有别人坐在座位购买旁边(左对齐或者右)或坐在他们前面或后面。
  
  这个计划应该保持.所有门票销售。用户应给予选择权的金额。
  
  这个项目也应给予·用户选择一个列表中看到多少座位都已经卖多少个席位,都可在每一行,并有多少座位都礼堂。
  
  输入验证:当门票售出,不接受排座位编号,或者根本不存在。当有人要求一个位子,该程序应该确保空座之前出售。执行排必须卖出几个座位(2个座位)。
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
手摇咖啡机多少钱一台,星巴克咖啡机具体型号
8090and快男谁更有实力
怎样把电视剧存到U盘里
我村庄有个肝硬化腹水老是反反复复怎麽办
梦见健康猫吃病,死猫,怎么回事?(好怕的感
现在的小孩子对性的关注有多少?
诗歌与水有关,跟丝绸之路有关的诗句
新险峰机械电子公司在哪里啊,我有事要去这个
与三星i908E 电池 通用的机型
求手机下图网
为什么DNF最近老是维护?太扫兴了吧?都不想
make sb done、反义疑问句
为什么我在体验服里面玩了几个小时也没送点?
问数码相机
2010年8月15号游戏到底什么时候好玩
推荐资讯
那里可以看美人心计高清全集?
人在看守所多久到法院
白雪公主故事的好句子,龟兔赛跑的好词好句好
深圳和东莞那个地方教好?
要和兄弟建立长久的友谊,我能做那些呢?
那个朋友告诉我现在还有没有sony的w320数码像
大家帮我设计一个Q名.
良乡哪里有卖直发膏
扬子江大酒店在什么地方啊,我要过去处理事情
战地之王怎么样注册啊,我注册了很多次都不行
我们的幸福感是怎么度量的
北部湾酒店我想知道这个在什么地方
正方形一边上任一点到这个正方形两条对角线的
阴历怎么看 ?