0% found this document useful (0 votes)
6 views3 pages

Week008 MachineProblem2

Uploaded by

Thia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views3 pages

Week008 MachineProblem2

Uploaded by

Thia
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Course

CS201
Code

Description Computer Programming 1


Title
Machine
of
Problem 002 Seat Reservation
Activit
No.
y
Page 1 of 3
LABORATORY EXERCISE
In this activity, you are to create a C++ program in VS code that satisfies specific
requirements to attain specific output.

Objective/s:
At the end of this activity, the students are expected to be able to:
 declare a two-dimensional array and other variables that will hold the
required data
 use conditional and looping statements accordingly
 display the required output

Material/s Needed:
Screen Recording Software
Visual Studio Code

MinGW

Procedure:
1. Create a video that shows yourself doing the machine problem.
2. The video should also show the screen of VS code as the program is coded.
3. The output window should be seen in the video as data is entered and the
corresponding output of the program is displayed.

Questions:(to be answered within the video)

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.

1
Course
CS201
Code

Description Computer Programming 1


Title
Machine
of
Problem 002 Seat Reservation
Activit
No.
y
Page 2 of 3
LABORATORY EXERCISE
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.

Sample Output:
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31 32 33 34 35

Enter seat number to reserve : 11

1 2 3 4 5 6 7
8 9 10 0 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31 32 33 34 35

Enter seat number to reserve :

2
Course
CS201
Code

Description Computer Programming 1


Title
Machine
of
Problem 002 Seat Reservation
Activit
No.
y
Page 3 of 3
LABORATORY EXERCISE

INSTRUCTIONS FOR THE STUDENTS:


The filename of your lab activity should be:
“<Last Name><First Name>-MachineProblem0<XX>”

Provide screenshots of your VS codes and program output copied to a Word file.
Save your video file in “.mp4” or “.avi” format only.

Upload your video to Google drive or any video sharing website such as YouTube

and Vimeo.

Copy the video link to a Word file, together with the screenshots of your VS codes
and program output.

 Upload the Word file to the link provided for the activity in the LMS.

You might also like