Question
I've been given this problem to work with: Write a C++ program with the following specifications: 1.Use two-dimensional array with size 7 columns and 5
I've been given this problem to work with:
Write a C++ program with the following specifications:
1.Use two-dimensional array with size 7 columns and 5 rows.
2.Seat numbers are populated during run-time.
3.User is asked to input a seat number.
4.Seat number chosen is replaced by 0.
5.Program displays a remark "Seat successfully reserved" when reservation is done.
6.User is not allowed to reserve a previously reserved seat.Display "Seat is taken" remarks.
7.User is not allowed to enter an invalid seat number.Display an error message.
8.Program continuously loops.
I am trying to accomplish this without using functions as I have not gotten to that point of the module yet.
This is the code I have so far: note that this is not complete, I'm still trying to develop a backbone that fulfills #2 and #8 before proceeding with the rest.
#include#include #include #include //#include"_pause.h"usingnamespacestd;////////////////////////////////////////////////////////////////////NOTE//Thisisyourprogramentrypoint.Yourmainlogicisplaced//insidethisfunction.Youmayaddyourfunctionsbeforethis//"main()",orafterthis"main()"providedyouaddedreference//beforethis"main()"function.//////////////////////////////////////////////////////////////////intmain(){intcount=1;intseat[5][7];intctr,ctr2;boolcont=true;charchoice[3];do{for(intctr=0;ctr>choice;if(choice=="Y"||choice=="YES"){cont=true;}else(cont==false);}while(cont=true);system("pause");return0;}
This is the output so far:
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started