Java When your app starts, it should provide the main menu GUI with four options
ID: 3835789 • Letter: J
Question
Java
When your app starts, it should provide the main menu GUI with four options of “Create Account”, “Reserve Seat”, “Cancel Reservation”, and “Manage System”.
Create a correct account
- Select "Create Account"
- Username: !!Stein8
- Password: !!Stein8
è The System informs the Customer that the new account has been created successfully.
After that, the System should display the main menu.
Manage the system - Verify the new account
- Select "Manage System"
- Username: !admiM2
- Password: !admiM2
è The system should display
1. Transaction type: New account
2. Customer's username: !!Stein8
3. Transaction date: Depending on the test case 2 execution date.
4. Transaction time (= hour and minute): Depending on the test case 2 execution time.
- In this test case, the System Operator doesn’t add new flight information.
è The System should display the main menu.
Create an incorrect account
- Select "Create Account"
- Username: stein8
- Password: !stein8
è The System should display an error message.
- Username: stein8!
- Password: stein8
è The System should display an error message again.
The Customer confirms the error message.
Then, it displays the main menu.
Create an incorrect account - Duplicated username
- Select "Create Account"
- Username: $BriAn7
- Password: 123aBc##
è System should display an error message.
- Username: !!Stein8
- Password: !!Stein8
è The system should display an error message again.
The Customer confirms the error message.
Then it displays the main menu.
Reserve seat
- Select "Reserve Seat"
- Departure: Monterey
- Arrival: Seattle
- Number of tickets: 2
è System should display two possible flights of Hartnell201 and Hartnell205
1. The Customer picks Hartnell201
2. The Customer enters Username: !!Stein8
Password: !!Stein8
3. The System confirms it and displays
- Username: !!Stein8
- Flight number: Hartnell201
- Departure: Monterey, 11:00(AM)
- Arrival: Seattle
- Number of tickets: 2
- Reservation number: Depending on the test.
- Total amount: $401.00
4. The Customer confirms it
5. The System displays the main menu.
Reserve seat - One more trial
- Select "Reserve Seat"
- Departure: Los Angeles
- Arrival: Monterey
- Number of tickets: 6
è System should display one possible flight of Hartnell102
1. The Customer picks Hartnell102
2. The Customer enters Username: !!Stein8
Password: !!Stein8
3. The System confirms it and displays
- Username: !!Stein8
- Flight number: Hartnell102
- Departure: Los Angeles, 1:00(PM)
- Arrival: Monterey
- Number of tickets: 6
- Reservation number: Depending on the test.
- Total amount: $900.00
4. The Customer confirms it
5. The System displays the main menu.
Reserve seat - Handle No Seats Available
- Select "Reserve Seat"
- Departure: Monterey
- Arrival: Los Angeles
- Number of tickets: 10
è System should inform the Customer that the reservation can’t be made due to the system restriction.
The Customer confirms the error message.
- Departure: Monterey
- Arrival: Los Angeles
- Number of tickets: 5
è System should display one possible flight of Hartnell101
1. The Customer picks Hartnell101
2. The Customer enters Username: !!Stein8
Password: !!Stein8
3. The System confirms it and displays
- Username: !!Stein8
- Flight number: Hartnell101
- Departure: Monterey, 10:30(AM)
- Arrival: Los Angeles
- Number of tickets: 5
- Reservation number: Depending on the test.
- Total amount: $750.00
4. The Customer confirms it
5. The System displays the main menu.
Reserve seat - Handle No Flight Available
- Select "Reserve Seat"
- Departure: Seattle
- Arrival: Los Angeles
- Number of tickets: 1
è The System informs the Customer that there is no flight available for the departure/arrival.
The System prompts the Customer to exit the program.
The Customer clicks the “Exit” and the System displays the main menu.
Cancel reservation - Handle No Reservation
- Select "Cancel Reservation"
- Username: !chriS12!
- Password: CHrIS12!!
è System should display
1. The System informs the Customer that there is no reservation with the username.
2. The Customer verifies this to continue.
3. The System displays the main menu.
Cancel reservation
- Select "Cancel Reservation"
- Username: !!Stein8
- Password: !!Stein8
è System should display
1. All three reservations of “!!Stein8” with the detailed information.
- Select "Hartnell102" to cancel it.
1. The System requests confirmation and the Customer confirms it.
2. The System should display the main menu.
Manage the system - Verify the cancellation
- Select "Manage System"
- Username: !admiM2
- Password: !admiM2
è The System should display all transactions so far. But our focus in this test case is the last transaction which should include
1. Transaction type: Cancellation
2. Customer's username: !!Stein8
3. Flight number: Hartnell102
4. Departure: Los Angeles, 1:00(PM)
5. Arrival: Monterey
6. Number of tickets: 6
7. Reservation number: Depending on the test.
8. Transaction date: Depending on the test case 11 execution date.
9. Transaction time (= hour and minute): Depending on the test case 11 execution time.
- In this test case, the System Operator doesn’t add new flight.
è The System should display the main menu.
Manage the system - Add a new flight
- Select "Manage System"
- Username: !admiM2
- Password: !admiM2
è The System should display logs. But it's not important at this test case.
- The System Operator selects the YES option to add a new flight.
1. Flight number: Hartnell301
2. Departure: Los Angeles
3. Arrival: Seattle
4. Departure time: 12:00(PM)
5. Flight capacity: 10
6. Price: $350.50
è The System requests confirmation and the System Operator confirms it.
After that, the System should display the main menu.
Manage the system - Handle Invalid Flight Information
- Select "Manage System"
- Username: !admiM2
- Password: !admiM2
è The system will display logs. But it's not important at this test case.
- The System Operator selects the YES option to add a new flight.
1. Flight number: Hartnell205
2. Departure: Seattle
3. Arrival: Los Angeles
4. Departure time: 2:00(PM)
5. Flight capacity: 5
6. Price: $300.00
è The System informs the System Operator that the information entered is not valid. In the test case, note that the flight number, Hartnell205, already exists.
The System Operator confirms the error message and the System should display the main menu.
Reserve seat - One more trial
- Select "Reserve Seat"
- Departure: Los Angeles
- Arrival: Seattle
- Number of tickets: 1
è System should display one possible flight of Hartnell301
1. The Customer picks Hartnell301
2. The Customer enters Username: !!Stein8
Password: !!Stein8
3. The System confirms it and displays
- Username: !!Stein8
- Flight number: Hartnell301
- Departure: Los Angeles, 12:00(PM)
- Arrival: Seattle
- Number of tickets: 1
- Reservation number: Depend on the test.
- Total amount: $350.50
4. The Customer confirms it
5. The System displays the main menu.
Explanation / Answer
import java.util.Scanner;
open class Airline
{
boolean[]
seating = new boolean[11];
/* make 10 situate numbers (array[0] won't be utilized).
Exhaust situate demonstrated by false
*/ Scanner input = new Scanner(System.in);
open void begin() { while
Private Sub Form_Load()
Dim db As Connection
Set db = New Connection
db.Open "Provider=MSDASQL.1;Persist Security Info=False;Data Source=NATH"
Set adors = New Recordset
ADORS2.Open "selectticket_no,pnr,flight_id,source,destination,t_date,d_time,a_time,fare1,fare2,fare3,fare4,fare5,far
e6,class,age1,sex1,seat1,age1,sex1,seat1,age2,sex2,seat2,age3,sex3,seat3,age4,sex4,seat4,age5,
sex5,seat5,age6,sex6,seat6,passenger from ticket_report", db, adOpenStatic, adLockOptimistic
Dim otext As TextBox
- Username: !!Stein8
- Flight number: Hartnell201
- Departure: Monterey, 11:00(AM)
- Arrival: Seattle
- Number of tickets: 2
- Reservation number: Depending on the test.
- Total amount: $401.00
Passenger agent Stein8 sends query to airline clerk agent C. println("admiM2" + " " + msg.getSender() + " " + "sending" + msg.getPerformative() + " " + "with query" + msg.getContents() + "to "+ msg.getReceiver())
For Each otext In Me.Text1
println(msg.getPerformative() + "handler of Stein8 " + msg.getReceiver() + "received query from " + msg.getSender() + "==>" +msg.getContents());
db.Open "Provider=MSDASQL.1;Persist Security Info=False;Data Source=NATH"
Set adors = New Recordset
Set adors1 = New Recordset
Set ADORS2 = New Recordset adors1.Open "select max(TICKET_NO)from ticket_report", db, adOpenStatic, adLockOptimistic
Private Sub PRINT_Click()
Ticket_report.Print
End Sub
System Operator doesn’t add new flight information.
Private Sub save_Click()
adors.UpdateBatch adAffectAllChapters
End Sub
Text3_LostFocus(Index As Integer)
Dim temp As Double
If Val(Text3(Index).Text) > 60 Then
temp = (5 * Val(Text5.Text) / 100)
MsgBox (temp)
Text4(Index).Text = temp
Else
temp = Val(Text5.Text)
End
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.