An Auto Insurance Program Example - Write a C++ program to determine the cost of an automobile insurance premium, based on driver's age and the number of accidents that the driver has had. The basic insurance charge is 500 Rs. There is a surcharge of 100 Rs if the driver is under 25 and there is an additional surcharge for accidents as can be seen below: No. of accidents Accident Surcharge 1 50 2 125 3 250 4 375 5 575 6 or more No insurance Note: Use switch cases when you check the total number of accidents.

Question
  1. An Auto Insurance Program
  • Example - Write a C++ program to determine the cost of an automobile insurance premium, based on driver's age and the number of accidents that the driver has had.
  • The basic insurance charge is 500 Rs. There is a surcharge of 100 Rs if the driver is under 25 and there is an additional surcharge for accidents as can be seen below:

 

 

No. of accidents

 

Accident Surcharge

1

50

2

125

3

250

4

375

5

575

6 or more

No insurance

 

Note: Use switch cases when you check the total number of accidents.

Expert Answer

Want to see the step-by-step answer?

Check out a sample Q&A here.

Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

*Response times may vary by subject and question complexity. Median response time is 34 minutes for paid subscribers and may be longer for promotional offers.
Tagged in
Engineering
Computer Science

Programing Language

Object Oriented Programming

Related Computer Science Q&A

Find answers to questions asked by students like you.

Q: Why does the network-layer protocol need to provide packetizing service to the transport layer? Whyc...

A: Network layer:   The network layer in the OSI model is the layer that is used to provide the facilit...

Q: Determine whether the follwing array declarations are valid, if a declaration is invalid, explain wh...

A: (d)   The declaration is invalid due to multiple reasons. Firstly the array size should be specifie...

Q: If you were to look at a machine language program, you would see __________. a. C# code b. a stream ...

A: A stream of binary numbers are simply combinations of 0’s and 1’s and machine language will comprise...

Q: write the sql code required to list the employee number, last name, first name, and middle initial o...

A: The structured Query Language (SQL) code to list the employee number, last name, first name, and mid...

Q: How does a command line interface work?

A: Click to see the answer

Q: Write a C code that given a date (year, month and day) finds and displays the next date. Consider al...

A: PROGRAM: //header files #include<stdio.h> #include <stdlib.h> //prototype of the functio...

Q: In order to access each element in an array, the For Each...Next statement needs to know the highest...

A: Traversing the array: Traversing an array means looking for each element one by one starting from f...

Q: Write a version of the binary search algorithm that can be used to search a string vector object. Al...

A: Algorithm: Algorithm for binary search to search a list of string are as follows: Compare the strin...

Q: True or False When developing applications that work with an intensive amount of data, most develope...

A: Many businesses keep hundreds of thousands or even millions of data items in file. If traditional fi...

Q: Describe wireless networking, including wireless standards, topologies, and trends

A: Wireless networking: Wireless local network is a relatively inexpensive to install and is well-suit...

Q: Write a programming statement that gives the focus to a TextBox control named numberTextBox.

A: Programming statement: The “Focus” method is used to move the focus to the control. The syntax for “...

Q: Latin Translator Look at the following list of Latin words and their meanings: Latin English siniste...

A: Program Plan: Design the Form: Place a Label and three Button controls on the form. Change the nam...

Q: SMS, iMessage, and WhatsApp are all smartphone real-time messaging systems. After doing some researc...

A: SMS: SMS (Short Message Service) is commonly known as Text message. With SMS, we can send a text mes...

Q: Describe the system requirements document

A: System requirements document: System requirements documents are the building blocks developers use ...

Q: Explain the method for providing keyboard access to a text box.

A: To issue keyboard access to the text box, allocate the access key to its associating or identifying ...

Q: Please use easy logic with proper indentations and comments for understanding!. Coding should be in ...

A: code: // print stars without loop using recursion #include <iostream> using namespace std; /...

Q: If a text box’s TabIndex value is 12, its identifying label’s TabIndex value should be _____________...

A: TabIndex: It is a property that is used to determine the sequence in which the focus gets received ...

Q: Assume that the following 10-bit numbers represent signed integers using sign/ magnitude notation. T...

A: a. 1000110001 Checking the leftmost digit, if the number is “1” then “-”, otherwise “+”. Here the le...

Q: Based on your reading of the chapter and what you now know about the issues, list at least three oth...

A: As we know, Charley and Iris met for the lunch and Charley recommended to the Iris. Based on my read...

Q: This is in C++. Please use easy logic with comments

A: Note: - As per the guidelines we can only answer one question at a time. Please resubmit the second ...

Q: Which of the following is true? a. Data stored in a relational database can be retrieved both quickl...

A: True statement: In relational database, the data is stored in relational format. So, the computer c...

Q: Engineers often measure the ratio of two power measurements in decibels, or dB, which can be calcula...

A: PROGRAM: //Header file #include <iostream> #include <math.h> //Using namespace using nam...

Q: A(n) __________ is a set of instructions that a computer follows to perform a task. a. compiler b. p...

A: Program: It is considered as a specific set of instructions the computer follows for performing a p...

Q: Explain the one way selection form.

A: One-way selection form: It performs some indicated action if a condition is true. If the condition i...

Q: Write an if statement that displays the message “The number is valid” in a message box if the variab...

A: "if" statement: "if" statement is used to make a decision structure, which permits the program to ...

Q: Suppose users share a 2 Mbps link. Also suppose each user transmits continuously at 1 Mbps when tran...

A: Given: users share a 2 Mbps link. Also suppose each user transmits continuously at 1Mbps when transm...

Q: Why should subroutines/procedures preserve the registers that they modify?

A: Advantages to preserve the registers that they modify by the subroutines: Fast, Easy and convient w...

Q: The Programming Example, Converting a Number from Decimal to Binary, contains a program that uses re...

A: Since you are not mentioning the programming language, here we are using C++ to complete the program...

Q: Give an example of a programming statement that uses string concatenation.

A: As you have not mentioned the programming language, we are answering this question in java.   Concat...

Q: What component is used to connect interface controls to a dataset?

A: Binding source is used for connecting the user interface controls to a dataset. 

Q: What statement do you use to close an application’s form in code?

A: An application contains form. Hence, when the application executes the available the form is display...

Q: Write a function f1 that takes the root of a binary tree as a parameter and returns the sum of the n...

A: “f1 ()” function: The “f1 ()” function for given conditions:  f1 (root r) {             //check root...

Q: Describe how to declare and manipulate data into arrays.

A: Declaring and manipulating arrays An array can be declared by two steps. The first step is to decla...

Q: True or False When you create a database table, the data types that you can choose from are C# data ...

A: When creating a database table, the user must specify a data type for the column. One of the accepta...

Q: Describe a primary key, candidate key, secondary key, foreign key, and a combination key. Use your i...

A: Primary key: Primary key is defined as the attribute in a table which can uniquely identifies all t...

Q: Using MySQL, populate the CUST_LNAME, CUST_FNAME, and CUST_BALANCE fields with the following custome...

A: MySql query to display CUST_LNAME, CUST_FNAME, and CUST_BALANCE fields: First step is to create the ...