Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that calculates the cost of an auto insurance policy. The program prompts the user to enter the age of the driver and

Write a program that calculates the cost of an auto insurance policy. The program prompts the user to enter the age of the driver and the number of accidents the driver has been involved in. The program should adhere to these additional requirements:

If the driver has more than 2 accidents and is less than the age of 25, deny insurance

If the driver has more than 3 accidents, deny insurance

Include a base charge of $500 dollars for all drivers

If a driver has 3 accidents, include a surcharge of $600

If a driver has 2 accidents, include a surcharge of $400

If a driver has 1 accident, include a surcharge of $200

If a driver is less than the age of 25, include an age fee

The total of the policy amount should include the base, any surcharge, and any age fee

Use a Boolean variable for the purpose of indicating a driver is insurable

Use at least one logical operator

Use at least one if - elif block

Outputs should display currency format with $ signs and commas for thousands as demonstrated in the following example outputs

Prompts and printed output should be formatted as in the example outputs

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

Step: 3

blur-text-image

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

Database Theory Icdt 99 7th International Conference Jerusalem Israel January 10 12 1999 Proceedings Lncs 1540

Authors: Catriel Beeri ,Peter Buneman

1st Edition

3540654526, 978-3540654520

More Books

Students also viewed these Databases questions

Question

Explain the strength of acid and alkali solutions with examples

Answered: 1 week ago

Question

Introduce and define metals and nonmetals and explain with examples

Answered: 1 week ago

Question

f. Did they change their names? For what reasons?

Answered: 1 week ago