Write a C++ Program that calculate and print the insurance for 15 cars. For each car, the program should read the following Insurance type(char), Car's Price (float) and year (int). The program will calculate and print the insurance according to the Insurance Type: G for Gold insurance or S for Silver insurance. Insurance Type Insurance Gorg - Price *0.017 - (2021-year)*5+ 140 Sors - Price *0.012 - (2021-year)*5+ 40 Other Show an error message and exit the loop. At the end, show. The number of cars with Gold insurance and The number of cars with Silver insurance. Sample Output: Enter Insurance Type, Car's year, and price: G 2021 15600 Insurance 405.2 Enter Insurance Type, Car's year, and price: S 020 8900 Insurance - 141.8 Enter Insurance Type, Car's year, and price: 5 2019 6500 Insurance = 113 Number of cars with Gold insurance is = 6 cars Number of cars with Silver insurance is = 9 cars

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter13: Structures
Section13.2: Arrays Of Structures
Problem 3E
icon
Related questions
Question
Write a C++ Program that calculate and print the insurance for 15 cars.
For each car, the program should read the following: Insurance type(char), Car's Price (float) and year (int).
The program will calculate and print the insurance according to the Insurance Type: G for Gold insurance or S for Silver insurance.
Insurance Type
Insurance
Gorg
= Price *0.017- (2021-year)*5 + 140
Sors
= Price *0.012 - (2021-year)*5 + 40
Other
Show an error message and exit the loop.
At the end, show:
The number of cars with Gold insurance and
The number of cars with Silver insurance.
Sample Output:
Enter Insurance Type, Car's year, and price:
G 2021 15600
Insurance = 405.2
Enter Insurance Type, Car's year, and price:
S 2020 8900
Insurance = 141.8
Enter Insurance Type, Car's year, and price:
5 2019 6500
Insurance = 113
Number of cars with Gold insurance is = 6 cars
Number of cars with Silver insurance is = 9 cars
Transcribed Image Text:Write a C++ Program that calculate and print the insurance for 15 cars. For each car, the program should read the following: Insurance type(char), Car's Price (float) and year (int). The program will calculate and print the insurance according to the Insurance Type: G for Gold insurance or S for Silver insurance. Insurance Type Insurance Gorg = Price *0.017- (2021-year)*5 + 140 Sors = Price *0.012 - (2021-year)*5 + 40 Other Show an error message and exit the loop. At the end, show: The number of cars with Gold insurance and The number of cars with Silver insurance. Sample Output: Enter Insurance Type, Car's year, and price: G 2021 15600 Insurance = 405.2 Enter Insurance Type, Car's year, and price: S 2020 8900 Insurance = 141.8 Enter Insurance Type, Car's year, and price: 5 2019 6500 Insurance = 113 Number of cars with Gold insurance is = 6 cars Number of cars with Silver insurance is = 9 cars
Other
At the end, show:
The number of cars with Gold insurance and
The number of cars with Silver insurance.
Sample Output:
Enter Insurance Type, Car's year, and price:
G 2021 15600
Insurance = 405.2
Enter Insurance Type, Car's year, and price:
S 2020 8900
Insurance = 141.8
Enter Insurance Type, Car's year, and price:
s 2019 6500
Insurance = 113
.....
Number of cars with Gold insurance is = 6 cars
Number of cars with Silver insurance is = 9 cars
Use the editor to format your answer
79 minutes remaining
DEV
Transcribed Image Text:Other At the end, show: The number of cars with Gold insurance and The number of cars with Silver insurance. Sample Output: Enter Insurance Type, Car's year, and price: G 2021 15600 Insurance = 405.2 Enter Insurance Type, Car's year, and price: S 2020 8900 Insurance = 141.8 Enter Insurance Type, Car's year, and price: s 2019 6500 Insurance = 113 ..... Number of cars with Gold insurance is = 6 cars Number of cars with Silver insurance is = 9 cars Use the editor to format your answer 79 minutes remaining DEV
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Algebraic Expressions
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