subject

Write a menu driven program that can be used to assign seats for a commercial airplane. the airplane has 13 rows, with six seats in each row. rows 1 and 2 are first class, rows 3 through 7 are business class, and rows 8 through 13 are economy class. your program must prompt the user to enter the following information:
a. ticket type (first class, business class, or economy class)b. desired seatso far the code i have is now can i go about finishing to retreive the user input ? (this is for c++)#include #include using namespace std; nt main(){ int r, c; char seat_resvr; char tic_type; char availability[13][6], reserved[2]; int row_num, col_num; char seats; cout < < "a program that lets you choose your seating arrangement on an airplane"; cout < < endl; char a[13][6]; for (int r = 0; r < 13; r++) { for (int c = 0; c < 6; c++) a[r][c] = '*'; } /*int row, seat; cin > > row > > seat; a[row - 1][seat - 1] = 'x'; */ cout < < " a b c d e f" < < endl; for (int r = 0; r < 13; r++) { cout < < "row" < < setw(3) < < r + 1 < < " "; for (int c = 0; c < 6; c++) cout < < a[r][c] < < ' '; cout < < endl; } cout < < endl < < "* -- available seat" < < endl < < "x -- occupied seat" < < endl < < endl < < "rows 1 and 2 are for first class passengers." < < endl < < "rows 3 through 7 are for business class passengers." < < endl < < "rows 8 through 13 are for economy class passengers." < < endl; cout < < "to reserve a seat enter y/y (yes), n/n(no): " < < endl; cin > > seat_resvr; reserved[2] = 'x'; return 0; }

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 07:00
For all machines-not just hammers- the user applies force force to the machine to the machine over a certain distance. a. input b. output c. duo d. none of the above
Answers: 1
question
Computers and Technology, 23.06.2019 00:30
Pl i need the answer now ! which one of the following is considered a peripheral? a software b mouse c usb connector d motherboard
Answers: 1
question
Computers and Technology, 24.06.2019 01:00
Verify each identity[tex] \frac{csc}{cot \: x \: + \: tan \: x} = cos \: x[/tex]
Answers: 1
question
Computers and Technology, 25.06.2019 06:20
If you want to change the speed of a layer's horizontal scrolling, what should you change? a. the x coefficient b. the y coefficient c. the virtual width d. the order of the game's layers select the best answer from the choices provided
Answers: 2
You know the right answer?
Write a menu driven program that can be used to assign seats for a commercial airplane. the airplane...
Questions
question
Mathematics, 11.10.2020 14:01
question
Mathematics, 11.10.2020 14:01
question
Mathematics, 11.10.2020 14:01
question
Mathematics, 11.10.2020 14:01
question
Mathematics, 11.10.2020 14:01
question
Mathematics, 11.10.2020 14:01
Questions on the website: 13722359