Question: QUESTION 2 Given the following main function: int main() int numDays: float totalCost char roomCategory: cout > roomCategory: cout > numDays: totalCost = calculate TotalCostiroomCategory,

QUESTION 2 Given the following main function: int main() int numDays: float totalCost char roomCategory: cout > roomCategory: cout > numDays: totalCost = calculate TotalCostiroomCategory, numDays) displayTotalCost (totalCost) return 0; ) a) Write the function definition for calculate TotalCost) that calculates the total cost for staying at the Green View Hotel. The calculation of the total cost is based on the room rate, the number of days to stay and any applicable discount as stated in the following table: Room Category Room Rate Discount Standard RM250 5% Deluxe RM350 10% Suite RM500 15% (7.5 marks) b) Write the function definition for displayTotalCost) that displays the total cost in an appropriate message. (2.5 marks)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
