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:
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
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](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F7f6c30ca-2a94-4f49-98e4-5db391fc2429%2Fa3dc55b4-c1bd-49d6-9507-8dce974740c4%2F49las99_processed.jpeg&w=3840&q=75)
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
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Recommended textbooks for you
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning