rint a ticket indicating the person's seat number and whether it’s in the first class or economy section of the train. Use a single-subscripted array to represent the seating chart of the train. Initialize all the elements of the
C LANGUAGE
A private railway company has just purchased a computer for its new automated reservations
system. You have been asked to write a program to assign seats on each train of the railway having
only (capacity: 100 seats). Your program should check whether it is a valid seat number or not.
Also print its berth type i.e lower berth, middle berth, upper berth, side lower berth, side upper
berth. Furthermore, then print a ticket indicating the person's seat number and whether it’s in the first
class or economy section of the train. Use a single-subscripted array to represent the seating chart
of the train. Initialize all the elements of the array to 0 to indicate that all seats are empty. As each
seat is assigned, set the corresponding element of the array to 1 to indicate that the seat is no longer
available.
Step by step
Solved in 2 steps with 3 images