Write a program to determine the cost of an automobile insurance premium, based on driver's age. and car price. > if given age or car price is negative, the user must be notified of wrong input > If the age is < 18 the customer will get no insurance : (under age) > Otherwise, the insurance is 3% of the car price. Below are some sample runs: run: Please enter your age and car price: 0 15000 Wrong input run:

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter6: User-defined Functions
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question
Write a program to determine the cost of an automobile insurance premium, based on driver's age.
and car price.
• if given age or car price is negative, the user must be notified of wrong input
> If the age is < 18 the customer will get no insurance : (under age)
> Otherwise, the insurance is 3% of the car price.
Below are some sample runs:
run:
Please enter your age and car price: 0 15000
Wrong input
run:
Please enter your age and car price: 15 20000
Under age, no insurance
using java
Name
run:
Please enter your age and car price: 25 20000
The cost of car insurance is: $600.0
Transcribed Image Text:Write a program to determine the cost of an automobile insurance premium, based on driver's age. and car price. • if given age or car price is negative, the user must be notified of wrong input > If the age is < 18 the customer will get no insurance : (under age) > Otherwise, the insurance is 3% of the car price. Below are some sample runs: run: Please enter your age and car price: 0 15000 Wrong input run: Please enter your age and car price: 15 20000 Under age, no insurance using java Name run: Please enter your age and car price: 25 20000 The cost of car insurance is: $600.0
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning