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.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.5: A Closer Look: Loop Programming Techniques
Problem 13E
icon
Related questions
Question
i need the answer quickly
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
steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Constants and Variables
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
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