Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a complete C++ program that helps the cashier to calculate the price of the rent movies. The program should perform the following tasks: Task

Write a complete C++ program that helps the cashier to calculate the price of the rent movies. The program should perform the following tasks: Task 1: Write a function named calcAverage. (4.5 inarks) a) It takes the total number of each rented movie type as input parameters. b) The function should calculate the average number of movies rented per movie type. c) It should return the average value calculated in (b). Task 2: Write a function named calcPrice. (9.5 marks) a) It takes the total rate as an input parameter. b) The function should calculate the final price based on the discount based on the conditions in Table 1. Table 1 Rate Range Below RM 35.00 Between RM 35.00 to RM 60.00 Above RM 60.00 Discount(%) 10 15 25 c) It should return the final price calculated in (b). Task 3: Write a function named getInput. (5.5 marks) a) This is a non-returning function. b) It takes the number of movies to rent for each movie type (movie type 1. movie type 2, and movie type 3) as input parameters. c) The function should ask the user to enter the number of movies to rent for each movie type. d) It sends all the values entered by the user in (c) back to the calling module through the use of reference parameters. Task 4: Write a function named dispRentalSummary (13 marks) a) This is a non-returning function. b) It takes the overall total of total rate and the total number of each rented movie type as input parameters. c) The function should display the overall total of total rate and the average number of movies rented per movie type by calling the calcAverage function as been shown in the Rental Summary section as in sample execution given below. d) The function also needs to determine which type of movie that have the highest total number of rental and how much the total number of the highest rented movie type.

only and from task 5image text in transcribed

Task 5: Write a main function to perform the following tasks: (21.5 inarks) a) You need to use an appropriate LOOP to perform the process in this function. The loop will be terminated when the user press 'N'. b) You are NOT ALLOWED to use arrays except an array of characters. c) The function should ask the user to enter a renter name. d) The function should calculate the total rate using the following formula: Total Rate = (Movie Type 1x2)+(Movie Ijpe 2*5)+(Movie Type 3x3.5) e) The function will sum up the overall total of total rate and calculate the total number of each rented movie type. f) The function may need to call the functions that are defined in Task 2, Task 3, and Task 4. g) The program should produce the output as in the sample execution given below. Note: The values in bold are input by the user. Task 6: List all function prototypes. (4 marks) Task 7: You must ensure your program fulfill the following criteria: (7 marks) a) The program is able to run. b) The program uses an appropriate structure for the program (e.g. all required header files are included, the program is properly written, proper indentation, etc.)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introductory Relational Database Design For Business With Microsoft Access

Authors: Jonathan Eckstein, Bonnie R. Schultz

1st Edition

1119329418, 978-1119329411

More Books

Students also viewed these Databases questions