Answered step by step
Verified Expert Solution
Question
1 Approved Answer
This is basically PGM-04-01.cpp modified with different selection structures. Assume that you are an auto insurance provider, and you need a program to determine
This is basically PGM-04-01.cpp modified with different selection structures. Assume that you are an auto insurance provider, and you need a program to determine the eligibility of applicants. The requirements are based on the age and sex of an applicant. Here is the table of requirements being used: Age Sex Less than 16 All Less than 18 18 thru 30 18 thru 30 31 thru 50 31 thru 50 51 thru 79 80 and over All Male Female Male Female All All Risk Level and code value Not insurable (code=0) High (code=1) High (code=1) Medium (code=2) Medium (code=2) Reduced (code=3) Low(code=4) High(code=1) Write a program that asks for the applicant's age and sex. Use logical operators in compound if statements that assign the correct code value to an applicant based on the table above. Once the code has been assigned, display a message based on that code using a switch statement with the code as the integer expression that displays a message such as "This is a low(or whichever risk level is appropriate) risk applicant" Partial Example Results (each execution is separated by //***... for clarity here; your program does not do that) COSC 1560 Programming Assignment 5- Auto Insurance Enter the age of the applicant: 14 Enter the sex of the applicant: M
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