Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ C++ Vehicle Type Sedan(S) Luxury (L) MPV (M) Rate per hour (RM/h) 20 35 45 Discount (> 18 hours) 10% 15% 20% a) Write
C++
C++
Vehicle Type Sedan(S) Luxury (L) MPV (M) Rate per hour (RM/h) 20 35 45 Discount (> 18 hours) 10% 15% 20% a) Write a function definition calculate TotalPrice () that accepts the vehicle type and total hours as parameters. Then, it will return calculated total price the customer should pay based on the table above.Discount from the total price only can be applied when customer rented the vehicle more than 18 hours. (8 marks) b) Write a function definition display TotalPrice () that accepts value of total price as parameter, which is calculated in Question 1 (a). The functions should display the total price with an appropriate message. (2 marks) Charges for renting a vehicle is based on type of vehicle and total hours it is rentedStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started