The objective of the question are to assess students understanding on the application of array, functions, selection and repetition program construct.
Examine the given information and answer questions that follow.
The alumni club has four conference rooms. The conference rooms can be booked for morning, afternoon and evening sessions by its members as per rates given in the following table and information: see image.
In addition, evening sessions costs another $50.
(a) Develop a function that takes a 2D array with the information shown in able 3.1, room number, day and session as parameters, traverses through the array to find the rental cost and surcharge. The function computes and returns the net rental cost as output. The function prototype is double calcNetRental(int[], int, int, char). Assume the following global declaration for day, enum day = { SUN = 1, MON, TUE, WED, THU, FRI, SAT};
(b) Write a test driver, which uses a 2-D array to store the information shown in Table 3.1. The driver prompts the user to enter the room number, day and the session and invokes the calcNetRental function to find and print the net rental charges. The driver program repeats with a while loop and terminates when the program encounters a sentinel value, E.