PG Car Rental Services is car Rental Company that provides services in Penang. Your company has obtained a contract from PG Car Rental Services to design, maintain and update their online system regularly. Minimum rental period should be 1 day for each booking. All the rental prices are subjected to Service Tax (SST). Therefore, total rental price must include 5% of SST. Table 1 lists rates of the first day, the rates of following days and SST rates for all type of cars.

A Guide to SQL
9th Edition
ISBN:9781111527273
Author:Philip J. Pratt
Publisher:Philip J. Pratt
Chapter4: Single-table Queries
Section: Chapter Questions
Problem 11CAT
icon
Related questions
Topic Video
Question
Write a C program
PG Car Rental Services is car Rental Company that provides services in Penang. Your company
has obtained a contract from PG Car Rental Services to design, maintain and update their online
system regularly. Minimum rental period should be 1 day for each booking. All the rental prices
are subjected to Service Tax (SST). Therefore, total rental price must include 5% of SST. Table
1 lists rates of the first day, the rates of following days and SST rates for all type of cars.
Table 1: List of rates and SST
Car Code
Car Type
Rates of the First
Rates of the
SST Rates
Day
Following Days
C
Compact Car
RM 100.00
RM 50.00
5%
S
Sedan
RM 150.00
RM 100.00
5%
H
Hatchback
RM 200.00
RM 150.00
5%
M
MPV
RM 250.00
RM 200.00
5%
You have been instructed to include the following functions:
(i)
float calculate_basicRent (char carCode, int day)
accept carCode and rental duration (day) from main function
calculates basic rental price for first and following days according to Table 1
return basic rental price to main function
(ii) void calculate_sst (float basicRent, float *sst)
accept basicRent price (as calculated in function (i)) from main function
calculates 5% SST from the basic rental price
(iii) void printReceipt (char carCode, int day, float basicRent, float sst)
accept carCode, rental duration (day), basicRent price, sst from main function
calculate total rental price
give 7% discount if total rental price exceeded RM 1000.00
display car type, rental duration (day), basic rent price, SST and total rental price
Transcribed Image Text:PG Car Rental Services is car Rental Company that provides services in Penang. Your company has obtained a contract from PG Car Rental Services to design, maintain and update their online system regularly. Minimum rental period should be 1 day for each booking. All the rental prices are subjected to Service Tax (SST). Therefore, total rental price must include 5% of SST. Table 1 lists rates of the first day, the rates of following days and SST rates for all type of cars. Table 1: List of rates and SST Car Code Car Type Rates of the First Rates of the SST Rates Day Following Days C Compact Car RM 100.00 RM 50.00 5% S Sedan RM 150.00 RM 100.00 5% H Hatchback RM 200.00 RM 150.00 5% M MPV RM 250.00 RM 200.00 5% You have been instructed to include the following functions: (i) float calculate_basicRent (char carCode, int day) accept carCode and rental duration (day) from main function calculates basic rental price for first and following days according to Table 1 return basic rental price to main function (ii) void calculate_sst (float basicRent, float *sst) accept basicRent price (as calculated in function (i)) from main function calculates 5% SST from the basic rental price (iii) void printReceipt (char carCode, int day, float basicRent, float sst) accept carCode, rental duration (day), basicRent price, sst from main function calculate total rental price give 7% discount if total rental price exceeded RM 1000.00 display car type, rental duration (day), basic rent price, SST and total rental price
The program output should be as follows
Welcome to PG Car Rental Services
Please enter car code: H
Please enter rental duration (minimum 1 day): 4
Rental Details
: Hatchback
: 4 day (s)
: RM 650.00
: 32.50
Car Type
Rental Period
Basic Rental Price
Service Tax
Total Rental Price
: RM 682.50
Do you want to continue? Y/N: Y
Welcome to PG Car Rental Services
Please enter car code: S
Please enter rental duration (minimum 1 day): 10
Rental Details
: Sedan
: 10 day (s)
: RM 1050.00
: 52.50
Car Type
Rental Period
Basic Rental Price
Service Tax
Total Rental Price
: RM 1025.32
Do you want to continue? Y/N: N
Transcribed Image Text:The program output should be as follows Welcome to PG Car Rental Services Please enter car code: H Please enter rental duration (minimum 1 day): 4 Rental Details : Hatchback : 4 day (s) : RM 650.00 : 32.50 Car Type Rental Period Basic Rental Price Service Tax Total Rental Price : RM 682.50 Do you want to continue? Y/N: Y Welcome to PG Car Rental Services Please enter car code: S Please enter rental duration (minimum 1 day): 10 Rental Details : Sedan : 10 day (s) : RM 1050.00 : 52.50 Car Type Rental Period Basic Rental Price Service Tax Total Rental Price : RM 1025.32 Do you want to continue? Y/N: N
Expert Solution
steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Knowledge Booster
Instruction Format
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage