Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Needed Urgently!! (ur kind help much appreciated) Question 165 Marks Write a complete C++ program that helps the cashier to calculate the price of the

Needed Urgently!!image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed (ur kind help much appreciated)

Question 165 Marks 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 marks) 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) le 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 Discount(%) 10 Rate Range Below RM 35.00 Between RM35.00 to RM 60.00 Above RM 60.00 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 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. Note: You are NOT ALLOWED to use any predefined function(s) to determine the highest number of rented movie types. Task 5: Write a main function to perform the following tasks: (21.5 marks) 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 (Move Type 1x2)+(Monte Type 2x 5) (Movie Typ 3X35) c) The function will sum up the overall total of total rate and calculate the total number of each rented movie type. ) 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 (eg. all required header files are included, the program is properly written, proper indentation, etc.) SAMPLE PROGRAM EXECUTION >>>>>> Renter Name : Nick Fury Movie Type 1: 1 Movie Type 2: 2 Movie Type 3: 1 >>>>>>>>>> Total Rate (RM): 15.5 Final Price (RM): 13.95 Press IN to stop...y >>>>>>>>>>>> Renter Name : Tony Stark Movie Type 1: 4 Movie Type 2: 4 Movie Type 3: 0 >>>>>>>>>> Total Rate (RM): 28 Final Price (RM) : 25.2 Press IN) to stop...m >>>>>>>>>>>> Renter Name : Natasha Romano Movie Type 1: 3 Movie Type 2: 4 Movie Type 3: 5 >>>>>>>>>> Total Rate (M): 43.5 Final Price (RM): 36.975 Press IN) to stop... >>>>>>>>>>>> Renter Name T'Challa Movie Type 1: 5 Movie Type 2: 2 Movie Type 3: 4 >>>>>>>>>> Total Rate (RM): 34 Final Price (RM) : 30.6 Press [N] to stop...k >>>>>>>>>>>> Renter Name : Steve Rogers Movie Type 1: 3 Movie Type 2:0 Movie Type 3: 1 >>>>>>>>>> Total Rate (RM): 9.5 Final Price (RM): 8.55 Press IN to stop...m >>>>>>>>>>>> Renter Name : Thor Odinson Movie Type 1: 3 Movie Type 2: 2 Movie Type 3: 4 >>>>>>>>>> Total Rate (RM) : 30 Final Price (RM): 27 Press IN to stop...n >>>>>>> Overall Total Rate (RM) : 160.5 Average for 3 types of rented movies: 16 Highest type of movie rented Movie Type 1 (19)

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

Step: 3

blur-text-image

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

Graph Database Modeling With Neo4j

Authors: Ajit Singh

2nd Edition

B0BDWT2XLR, 979-8351798783

More Books

Students also viewed these Databases questions

Question

To find integral of sin(logx) .

Answered: 1 week ago