subject

Write a 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;int 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 06:30
Exchanging which type of data uses the least bandwidth? music photographs video voice bandwidth- the amount of data that can be moved between two points in a set time period
Answers: 1
question
Computers and Technology, 23.06.2019 01:30
Jason works as an accountant in a department store. he needs to keep a daily record of all the invoices issued by the store. which file naming convention would him the most? a)give the file a unique name b)name the file in yymmdd format c)use descriptive name while naming the files d)use capital letters while naming the file
Answers: 3
question
Computers and Technology, 23.06.2019 06:40
What are the three uses of a screw?
Answers: 2
question
Computers and Technology, 23.06.2019 12:10
2. fabulously fit offers memberships for$35 per month plus a $50 enrollmentfee. the fitness studio offersmemberships for $40 per month plus a$35 enrollment fee. in how many monthswill the fitness clubs cost the same? what will the cost be?
Answers: 1
You know the right answer?
Write a program that can be used to assign seats for a commercial airplane. The airplane has 13 rows...
Questions
question
Mathematics, 03.03.2021 15:30
question
Mathematics, 03.03.2021 15:30
question
Mathematics, 03.03.2021 15:30
question
Mathematics, 03.03.2021 15:30
question
Mathematics, 03.03.2021 15:30
question
Chemistry, 03.03.2021 15:30
Questions on the website: 13722362