Question: can you write me one whole code for this: CPS 2 7 1 Machine Problem 1 Classes Objectives: implement a class and composition. To use
can you write me one whole code for this: CPS Machine Problem Classes
Objectives: implement a class and composition.
To use the dynamic allocation to store objects and their data.
To use default constructor and overload constructor with full parameters.
To use destructors.
To use setter functions and getter functions.
To use constant and static members.
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. The output will show the results of most of the functions. For example, if you set the data, show me the output of the old and the new data to make sure the set function works.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
