This is basically PGM-04-01.cpp modified with different selection structures. Assume that you are an auto insurance...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 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
Expert Answer:
Related Book For
Microeconomics An Intuitive Approach with Calculus
ISBN: 978-0538453257
1st edition
Authors: Thomas Nechyba
Posted Date:
Students also viewed these programming questions
-
What are some of the key differences between managers and leaders?
-
Assume that you are an independent CPA performing audits of financial statements. In the course of your work, you encounter the following independent situations. Review each of the situations. If you...
-
Frits Seegers, President of Citibank California, was meeting with his management team to review the performance evaluation and bonus decisions for the California branch managers. James McGarans...
-
Taxpayer sold the following capital assets during the year: Asset # 1: $60,000 long-term capital gain Asset # 2: $10,000 long-term capital loss Asset # 3: $50,000 short-term capital gain Asset # 4:...
-
Which of the following molecules may show infrared absorption spectra? (a) CH3CH3, (b) CH4, (c) CH3CI, (d) N2
-
For the network of Fig. 5.151, determine Vcc for a voltage gain of Av = -200. 4.7
-
A channel has a rectangular cross section, a width of \(40 \mathrm{~m}\), and a flow rate of \(4000 \mathrm{~m}^{3} / \mathrm{s}\). The normal water depth is \(20 \mathrm{~m}\). The flow then...
-
Determine the horizontal and vertical components of force at pin B and the normal force the pin at C exerts on the smooth slot. Also, determine the moment and horizontal and vertical reactions of...
-
If individual values that underline ethics are developed at a young age, what might this suggest about the potential for ethical conflicts to arise within an organization?
-
Roadrunner Bookstore uses the perpetual inventory system. Roadrunner Bookstore is owned by Tina Smith. The company had the following transactions for the month of September. Sep 1 Sep 2 Sep 4 Sep 5...
-
Assume that a < b and let L be the arc length (circumference) of the ellipse (A) + () = 1 shown in Figure 2. There is 1-a/b. Use the first three no explicit formula for L, but it is known that L =...
-
4 5 6 7 -8 -9 0 -1 2 -3 4 -5 6 A 9 -0 B 3 Drift Forecasting A forecast is always based on a "hypothesized scenario". 5 As we said earlier in this Workbook, developing a hypothesized scenario is...
-
Beginning Retained Earnings are $40,000 sales are $53,800 expenses are $44,000 and dividends paid are $2,900. How much is the net income or loss for the company?
-
X grants 100,000 options to employees having a fair value of $6/option, exercisable in 2 years year at $10. The options will vest only if X achieves a specified revenue target for the year. Half the...
-
Jamie is employed in Qubec and earns $2,300.00 semi-monthly. Her TD1 claim code is 2, and her TP-1015.3-V deduction code is B. Calculate her total deductions this pay period. Your answer Previous...
-
In Year 1, Chim purchased 100 shares of preferred stock of Donald Corporation for $5,000. In Year 3, she received a stock dividend of 20 additional shares of preferred stock in Donald. On the date of...
-
Write a shell script to find factorial of given number n.
-
Experiment: Tossing four coins Event: Getting three heads Identify the sample space of the probability experiment and determine the number of outcomes in the event. Draw a tree diagram when...
-
Adaptive Expectations and Oil Price Instability: We mentioned in the text that trading across time is similar to trading across space in that individuals find opportunities to buy low and sell high....
-
Suppose you have 60 hours of leisure that you could devote to work per week, and suppose that you can earn an hourly wage of $25. A: Suppose the government imposes a 20% tax on all wage income. (a)...
-
Syllabi-Induced Tastes over Exam Grades: Suppose you are taking two classes, economics and physics. In both classes, only two exams are given during the semester. A: Since economists are nice people,...
-
For many years, womens professional basketball struggled for consistency in the United States. Since 1978, when the Womens Professional Basketball League (WBL) was formed, leagues have had difficulty...
-
What are the five forms of financing, and how is each used within sport?
-
That financial ratios are most valuable when viewed in comparison to the organizations historical ratio values and competitors values. Why is this context valuable when examining financial ratio...
Study smarter with the SolutionInn App