Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1 Write the header file and the implementation file for each of the following classes ( declare all possible functions as constant ) . Name
Write the header file and the implementation file for each of the following classes declare all possible functions as constant
Name class:
Data members to store:
first father family
Default constructor; initialize first, father and family to empty string.
post: first; father; family;
Constructor with parameters set first, father and family according to the parameters.
post: firstf; fatherr; familym;
Function to set first, father and family according to the parameters.
post: firstf; fatherr;; familym;
Functions to return first, father and family data members.
post: first; father; family
Function to output first, father, and family in the form:
first father family.
Date class:
Data members to store:
day month year
Default constructor; initialize day, month and year to be:
day month year;
Constructor with parameters set day, month and year according to the parameters.
post: dayd; monthm; yeary;
Function to set day, month and year according to the parameters. post: dayd; monthm; yeary;
Functions to return day, month and year data members. post: day; month; year;
Function to output day, month, and year in the form : daymonthyear ddmmyyyy
LicenseType Class:
Data members to store:
type description
Default constructor; initialize type and description to be: type description"Private passenger vehicle";
Constructor with parameters set type and description according to the parameters. post: typet; descriptiond;
Function to set type and description according to the parameters. post: typet; descriptiond;
Functions to return type and description data members. post: type; description;
Function to output type and description in the form: type description egBuses
Note: Use the following guide table for license types and their descriptions:
w All types of motorcycles
w Construction vehicle
w Agricultural vehicle
w Private passenger vehicle
w Commercial passenger vehicle
w Minibus
w Buses
w Trailer and semitrailer
w vehicle equipped for disabled
LicenseRestrictions:
Data members to store:
number restrictions
Default constructor; initialize number and restriction to be: number restriction;
Constructor with parameters set number and restriction according to the parameters. post: numbern; restrictionr;
Function to set number and restriction according to the parameters. post: numbern; restrictionr;
Functions to return number and restriction data members. post: number; restriction;
Function to output number and restriction in the form: number restriction egDisabled
Note: Use the following guide table for numbers and their corresponding restrictions:
Default constructor; initialize number and restriction to be: number restriction;
Constructor with parameters set number and restriction according to the parameters. post: numbern; restrictionr;
Function to set number and restriction according to the parameters. post: numbern; restrictionr;
Functions to return number and restriction data members. post: number; restriction;
Function to output number and restriction in the form: number restriction egDisabled
Note: Use the following guide table for numbers and their corresponding restrictions:
w Glasses
w Earphones
w Automatic
w Disabled
w Lenses
w Deaf
DrivingLicense Class
Data members to store:
name
licenseCenter
nationality
licenseNumber
nationalNumber
issueDate
birthDate
expiryDate
gender
type
address
restriction
bloodGroup
HowManyLicenses
Default constructor; initialize all related data to reasonable values.
Constructor with parameters set all related data.
Function to set all related data.
Functions to return all related data.
Function to output all related data.
Function permits to change driving license data.
Static function to return how many driving license have been issued
HowManyLicenses is a static variable keeps track of how many DrivingLicense have been issued. This is done by incrementing the static variable, HowManyLicenses, with each construction and decrementing it with each destruction.
Write a main program Application or Driver to test the reliability and validity of the above classes.
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