Question: Write a C + + program that reads the following inputs: i ) ID number ii ) Driving speed iii ) Vehicle type B for

Write a C++ program that reads the following inputs:
i) ID number
ii) Driving speed
iii) Vehicle type B for bus (10 drivers) and C for car (10drivers)
Calculate a summon depends on the kind of vehicle:
i) Bus: Driving speed -90*100;
ii) Car: Driving speed -110*100;
Requirements:
1) Must have a base class with common members: ID Number and Driving Speed
2) Must have two derived class. One for Bus, and another for Car
3) Must have a constructor that print for example "Offence Committed on Tuesday 21 Mei 2022 At Jalan Petaling"
4) Error checking of all the three inputs (ID Number, Driving Speed, and Vehicle Type)
5) Report must be produced in an output file called "Offence.txt"
Assumptions:
1) All the 20 drivers are driving more than their legal speed
2) These twenty drivers operate either buses or cars
3) There may have been a mixup regarding the automobiles used in the offense. As an illustration, consider cases B, C, and B once more
Report: "Offence.txt"
i) Formatted with header
ii) Report must divided into two: Bus and Car and sorted by the speed
iii) Show a total summon for the day
iv) Show the highest driving speed of both vehicle type

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!