帮助订票预订系统问题。 [英] Help ticket reservation system problem.

查看:73
本文介绍了帮助订票预订系统问题。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

ı花了2个小时但我无法解决这个问题我错过了一周的课程因为疾病所以我很困惑这个问题请帮助我





票务预订系统

您是一名在线预订公司Biletix的IT部门工作的计算机工程师。你要求
开发一个新的应用程序来分配StüdyoSahne的座位(容量:12个座位)。您的

申请要求进行以下操作:

1查看SeatPlan

2预订

3查看预订

4退出

系统要求选择操作,直到用户选择4(退出)。

1查看SeatPlan:用户选择1
$ b $b§应用程序显示包含行和座位的座位计划。每行

有3行和4个座位。
$ b $b§最初,所有座位都是空的,表示为 - 。如果您预订座位,那么座位

已满,并表示为X.格式如下:



To按住剧院大厅的座位平面图,使用布尔类型的一维数组,

seatArray。

o将所有元素初始化为false表示所有座位都是空的。

false false false false false false false false false false false

•要保存客户名称,请使用String类型的一维数组customerArray。 br />
o将所有元素初始化为(空字符串)以表示所有客户都是空的。

•用户输入行号和座位号,然后输入客户名称。

(a)如果所选行/座位是免费的(检查座位未被预留 - 假),程序

通过

o进行预订将seatArray上的相应索引设置为true。

o将客户名称记录到相应的cus索引中tomerArray。

(b)如果所选行/座位已满(检查座位是否已保留 - 是),您的应用程序会打印一张

信息来预订另一个座位。

例如假设在10次操作之后,阵列的状态如下。用户在第11次操作中选择2作为

并输入2 3作为行/座位,名称为Maya。该程序检查第二排第三个座位是否可用
。如果可用,该程序进行预订。





示例输出:

欢迎!!!请选择

1查看SeatPlan

2预订

3查看预订

4退出

运营:2

第一排(价格100 TL)

第二排(价格50 TL)

第3排(价格25 TL) )

选择Row&座位:3 1

姓名:selen

Row3 / Seat1保留。

1查看SeatPlan

2制作预订

3查看预订

4退出

操作:2

第一排(价格100 TL)

第二排(价格50 TL)

第3排(价格25 TL)

选择Row&座位:1 4

姓名:elif

Row1 / Seat4保留。

1查看SeatPlan

2制作预订

3查看预订

4退出

操作:1

Row1 1-- 2--- 3- - 4-X

第2行1-- 2--3-- 4--

第3行1-X 2-- 3-- 4 -

1查看SeatPlan

2预订

3查看预订

4退出

操作:2

第一排(价格100 TL)

第二排(价格50 TL)

第3排(价格25 TL)

选择行&座位:1 2

姓名:阿里

第1行/座位2保留。

1查看SeatPlan

2制作预订

3查看预订

4退出

操作:1

Row1 1-- 2-X 3- - 4-X

第2行1-- 2--3-- 4--

第3行1-X 2-- 3-- 4 -

1查看SeatPlan

2预订

3查看预订

4退出

运营:3

输入姓名:ELIF

预订详情:

姓名:ELIF

Row1 / Seat4

1查看SeatPlan

2预订

3查看预订

4退出

操作:4

退出...



我尝试过:



包homelab05;

import java.util.Scanner;

公共类问题{



public static void main(String [] args){

// TODO自动生成方法存根

扫描仪键盘=新扫描仪(System.in) ;

int i;

String whole,full = - X,empty = - ;

String chair [] = new String [12];

boolean [] seating = new boolean [12];

System.out.println(欢迎!!!请选择);

System.out.println(1查看SeatPlan);

System.out.println(2 Make Reservation);

System.out.println(3 View Reservation);

System.out.println(4 Exit);

System.out。 println(操作:);

System.out.println(Row1 1+ chair [1] +2--3--4--);







}





public String methodName(boolean b)

{

boolean [] seating = new boolean [12];

String chair [] = new String [12];

int i = 0;

String full = - X,empty = - ,str =;

座位[1] =真;

if(座位[1] == true)

{

chair [1 ] =完整;



}返回椅子[1];

}



//System.out.println(\"Row2 1-- 2--3--4--);

//System.out.println(\"Row3 1- 2- - 3-- 4--);



}

ı spent 2 hours yet i cant solve this question i missed a week of class becouse of illness so i am confused about the question very much please help me


Ticket Reservation System
You are a computer engineer working in the IT department of Biletix, a company of online reservation. You
are asked to develop a new application to assign seats on the Stüdyo Sahne (capacity: 12 seats). Your
application asks for the following operations:
1 View SeatPlan
2 Make Reservation
3 View Reservation
4 Exit
The system asks to select an operation until the user selects 4 (Exit).
1 View SeatPlan: User selects 1
§ The application displays the seat plan with the rows and the seats. There are 3 rows and 4 seats per
each row.
§ Initially, all seats are empty and represented as - . If your make a reservation for a seat, then the seat
is full and represented as X. The format is as follows:

To hold the seating plan of the theater hall, use a one-dimensional array of type boolean,
seatArray.
o Initialize all the elements to false to indicate that all the seats are empty.
false false false false false false false false false false false false
• To hold the customer names, use a one-dimensional array of type String, customerArray.
o Initialize all the elements to ""(empty string) to indicate that all the costumers are empty.
• User enters row and seat number, and then the customer name.
(a) If the selected row/seat is free (check the seat was not reserved - false), the program
makes reservation by
o Setting the corresponding index on the seatArray to true.
o Recording the customer name to the corresponding index of the customerArray.
(b) If the selected row/seat is full (check the seat was reserved - true), your application prints an
info message to reserve another seat.
e.g. Assume that after 10 operations, the states of the arrays are as follows. The user selects 2 as
the 11th operation and enters "2 3" as row/seat, name "Maya" . The program checks if the 3rd seat
on the 2nd row is available. If it is available, the program makes the reservation.


Example output:
Welcome!!! Please select
1 View SeatPlan
2 Make Reservation
3 View Reservation
4 Exit
Operation: 2
1st Row (Price 100 TL)
2nd Row (Price 50 TL)
3nd Row (Price 25 TL)
Select Row & Seat: 3 1
Name: selen
Row3/Seat1 is reserved.
1 View SeatPlan
2 Make Reservation
3 View Reservation
4 Exit
Operation: 2
1st Row (Price 100 TL)
2nd Row (Price 50 TL)
3nd Row (Price 25 TL)
Select Row & Seat: 1 4
Name: elif
Row1/Seat4 is reserved.
1 View SeatPlan
2 Make Reservation
3 View Reservation
4 Exit
Operation: 1
Row1 1-- 2-- 3-- 4-X
Row2 1-- 2-- 3-- 4--
Row3 1-X 2-- 3-- 4--
1 View SeatPlan
2 Make Reservation
3 View Reservation
4 Exit
Operation: 2
1st Row (Price 100 TL)
2nd Row (Price 50 TL)
3nd Row (Price 25 TL)
Select Row & Seat: 1 2
Name: Ali
Row1/Seat2 is reserved.
1 View SeatPlan
2 Make Reservation
3 View Reservation
4 Exit
Operation: 1
Row1 1-- 2-X 3-- 4-X
Row2 1-- 2-- 3-- 4--
Row3 1-X 2-- 3-- 4--
1 View SeatPlan
2 Make Reservation
3 View Reservation
4 Exit
Operation: 3
Enter Name:ELIF
Reservation Details:
Name:ELIF
Row1/Seat4
1 View SeatPlan
2 Make Reservation
3 View Reservation
4 Exit
Operation: 4
Exit...

What I have tried:

package homelab05;
import java.util.Scanner;
public class Question {

public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner keyboard = new Scanner(System.in);
int i;
String whole,full="-X",empty="--";
String chair[] = new String[12];
boolean[] seating = new boolean[12];
System.out.println("Welcome!!! Please select");
System.out.println("1 View SeatPlan");
System.out.println("2 Make Reservation");
System.out.println("3 View Reservation");
System.out.println("4 Exit");
System.out.println("Operation: ");
System.out.println("Row1 1"+chair[1]+"2-- 3-- 4--");



}


public String methodName(boolean b)
{
boolean[] seating = new boolean[12];
String chair[] = new String[12];
int i=0;
String full="-X",empty="--",str="";
seating[1]=true;
if(seating[1]==true)
{
chair[1]=full;

}return chair[1];
}

//System.out.println("Row2 1-- 2-- 3-- 4--");
//System.out.println("Row3 1-- 2-- 3-- 4--");

}

推荐答案

我们不做你的作业:这是有原因的。它就是为了让你思考你被告知的事情,并试着理解它。它也在那里,以便您的导师可以识别您身体虚弱的区域,并将更多的注意力集中在补救措施上。



亲自尝试,你可能会发现它不是和你想的一样困难!



如果遇到具体问题,请询问相关问题,我们会尽力提供帮助。但是我们不打算为你做这一切!
We do not do your homework: it is set for a reason. It is there so that you think about what you have been told, and try to understand it. It is also there so that your tutor can identify areas where you are weak, and focus more attention on remedial action.

Try it yourself, you may find it is not as difficult as you think!

If you meet a specific problem, then please ask about that and we will do our best to help. But we aren't going to do it all for you!


你可以去 Java™教程 [ ^ ]学习一些你错过的东西。或者,更好的是,去和老师交谈并询问缺失的笔记。
You can go to The Java™ Tutorials[^] to learn some of the things you missed. Or, better still, go and talk to your teacher and ask for the missing notes.


这篇关于帮助订票预订系统问题。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆