Question: Write a program that simulates how a car insurance company determines your premium. The insurance premium is based on the user's gender, age, and number
Write a program that simulates how a car insurance company determines your premium. The insurance premium is based on the user's gender, age, and number of traffic tickets he has received (numTix). The formula for determining the insurance premium is:
Gender | Age | Premium |
Male | Under 21 | 1500 + 200 * numTix |
Male | 21 to 29 | 1200 + 100 * numTix |
Male | Over 29 | 1000 + 100 * numTix |
Female | 21 and under | 1200 + 200 * numTix |
Female | Over 21 | 1000 + 100 * numTix |
The program has been written for you. All you need to do is add the nested decision structure that will correctly calculate the premium. Use this decision making graph to help you design your nested decision structure. Download CarInsurancePremiumTemplate.cpp and add your code in the indicated place. Do NOT modify any of the existing code.
NOTE: You must use a nested decision structure to receive credit.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
