Question
Create a basic/simple C programming using strings, arrays, loops and if statements. Consider the following scenarios: Welcome to UNM bus seats reservation system. Seats 1A
Create a basic/simple C programming using strings, arrays, loops and if statements.
Consider the following scenarios:
Welcome to UNM bus seats reservation system.
Seats 1A 3D: RM30. Seats 4A 6D: RM25. Seats 7A 9D: RM20.
AB CD
1 OO OO
2 OO OO
3 OO OO
4 OO OO
5 OO OO
6 OO OO
7 OO OO
8 OO OO
9 OO OO
Choose your seat (such as 1A) or Q to quit the program: 1A
AB CD
1 XO OO
2 OO OO
3 OO OO
4 OO OO
5 OO OO
6 OO OO
7 OO OO
8 OO OO
9 OO OO
You booked seat 1A. Your ticket price is: RM30.
There are 35 seats available.
Choose your seat (such as 1A) or Q to quit the program: 4D
AB CD
1 XO OO
2 OO OO
3 OO OO
4 OO OX
5 OO OO
6 OO OO
7 OO OO
8 OO OO
9 OO OO
You booked seat 4D. Your ticket price is: RM25.
There are 34 seats available.
Choose your seat (such as 1A) or Q to quit the program: 9C
AB CD
1 XO OO
2 OO OO
3 OO OO
4 OO OX
5 OO OO
6 OO OO
7 OO OO
8 OO OO
9 OO XO
You booked seat 9C. Your ticket price is: RM20.
There are 33 seats available.
Choose your seat (such as 1A) or Q to quit the program: 1A
AB CD
1 XO OO
2 OO OO
3 OO OO
4 OO OX
5 OO OO
6 OO OO
7 OO OO
8 OO OO
9 OO XO
Seat 1A is already booked. Choose another seat.
There are 33 seats available.
Choose your seat (such as 1A) or Q to quit the program: Q
Thanks for using UNM bus. Goodbye.
Q1. Create a system for UNM bus seats reservation that looks similar to the output below. All seats are marked with a unique letter "O" and will change to another letter "X* when booked. The system will inform the user when trying to book a seat that was booked already. The system should also show the number of available seats after each booking. The code must satisfy the following conditions: The price of each seat in rows 1 to 3 is RM30, rows 4 to 6 is RM25, and rows 7 to 9 is RM20. The program must receive the user's entries. The user should quit the program when enteringStep 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