Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 drivers and C for car drivers
Calculate a summon depends on the kind of vehicle:
i Bus: Driving speed ;
ii Car: Driving speed ;
Requirements:
Must have a base class with common members: ID Number and Driving Speed
Must have two derived class. One for Bus, and another for Car
Must have a constructor that print for example "Offence Committed on Tuesday Mei At Jalan Petaling"
Error checking of all the three inputs ID Number, Driving Speed, and Vehicle Type
Report must be produced in an output file called "Offence.txt
Assumptions:
All the drivers are driving more than their legal speed
These twenty drivers operate either buses or cars
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started