Car maintenance booking provide the user the information for booking purposes. The information of the booking services has several information such as slot number and status that are stored in a file named “Services.txt”. In this case, the slot number will be used to locate the slot, while the status will be used to know the availability of the slot (i.e. ’1’ indicate the slot is occupied and ’0’ indicate the slot is available). Assuming there are 12 slot available, and have been indexed from 1 to 12. You are required to develop a C program that can access the data from “Services.txt”. file, and manage the slot information with the following requirements: Based on user selection, the program will perform one of the two following options: 1 – Search. The program should be able to display the status, based on the slot number entered by user. 2 – Booking. A function (in 3 (a)) is called to list out all available slot (which is indicated by status ’0’). Another function (in 3 (b)) will be called to process the booking procedures. Your program should be able to continue until the user has decided to exit the program. Before the program is terminated, all data will be written in " Services.txt" file. b) Develop a function definition that bring one parameter as its argument (i.e. the array that store slot number and availability status). In this function, the user is required to key in a slot number. It is important to make sure the user can book ONLY on an available slot. Therefore, your program will not proceed if the index of the slot number entered by user is occupied (i.e. status is ’1’).
Car maintenance booking provide the user the information for booking purposes. The
information of the booking services has several information such as slot number and status that
are stored in a file named “Services.txt”. In this case, the slot number will be used to locate the
slot, while the status will be used to know the availability of the slot (i.e. ’1’ indicate the slot
is occupied and ’0’ indicate the slot is available). Assuming there are 12 slot available, and
have been indexed from 1 to 12. You are required to develop a C program that can access the
data from “Services.txt”. file, and manage the slot information with the following requirements:
Based on user selection, the program will perform one of the two following options:
1 – Search. The program should be able to display the status, based on the slot number
entered by user.
2 – Booking. A function (in 3 (a)) is called to list out all available slot (which is
indicated by status ’0’). Another function (in 3 (b)) will be called to process the booking
procedures.
Your program should be able to continue until the user has decided to exit the program.
Before the program is terminated, all data will be written in " Services.txt" file.
b) Develop a function definition that bring one parameter as its argument (i.e. the array
that store slot number and availability status). In this function, the user is required to
key in a slot number. It is important to make sure the user can book ONLY on an
available slot. Therefore, your program will not proceed if the index of the slot number
entered by user is occupied (i.e. status is ’1’).
Step by step
Solved in 5 steps with 2 images