Answered step by step
Verified Expert Solution
Link Copied!

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 

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microeconomics An Intuitive Approach with Calculus

Authors: Thomas Nechyba

1st edition

538453257, 978-0538453257

More Books

Students also viewed these Programming questions

Question

Web 3 . 0 is also called

Answered: 1 week ago

Question

Draw a labelled diagram of the Dicot stem.

Answered: 1 week ago