Question
Write a c++ program for insurance company to calculate the monthly premiums for its customers. Customers should pay a standard fee of $850.00 per month.
Write a c++ program for insurance company to calculate the monthly premiums for its customers. Customers should pay a standard fee of $850.00 per month. In addition to the standard fee, the following fees are applicable:
Experience:Experienced drivers pay less than less experienced drivers as follows:
0-2 years pay $150.00 extra
3-5 years pay $80.00 extra
6 and more years pay only $30 extra.
Age: Younger people pay more than older citizens as follows:
18-28: pays $50.00 extra
29-45: pays $30.00 extra
46-60: pays $20.00 extra
61 and above pays $30.00 extra
Gender: Male customers pay an additional $10.00
Marital status: Single people or divorced(available) pay more than those who are married or living with partners(not available)
Available pays $40.00 extra.
Write the following functions:
driversGroup: This function takes as its parameter driving experience and it returns the additional fee that the customer will have to pay.
ageGroup: This function takes as its parameter the age of the driver and it returns the additional fee that the customer will have to pay. The age should not be less than 18 years.
isMail: This function takes as its parameter the gender of the driver and it returns a true value if it is male. The function should only accept 'M' or 'm' for Male and 'F' or 'f' for female.
isAvailable:This function takes as its parameter the marital status of the driver and it returns a true value if the customer is Single or Divorce.The function should only accept 'S' or 's' for single. 'D' or 'd' for divorces, 'M' or 'm' for married, and 'L' or 'l' for living with a partner.
computePremium: The function takes as its parameters the experience, age, gender and marital status and return the total premium to be paid. This function should use the functions above.
Add a main() function to demonstrate the use of these functions.
Step 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