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 271 Machine Problem 1 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.
(1) 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:
1. first 2. father 3. 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: first=f; father=r; family=m;
Function to set first, father and family according to the parameters.
post: first=f; father=r;; family=m;
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:
1. day 2. month 3. year
Default constructor; initialize day, month and year to be:
day=1, month=1, year=1990;
Constructor with parameters set day, month and year according to the parameters.
post: day=d; month=m; year=y;
Function to set day, month and year according to the parameters. post: day=d; month=m; year=y;
Functions to return day, month and year data members. post: day; month; year;
Function to output day, month, and year in the form : day/month/year (dd/mm/yyyy)
LicenseType Class:
Data members to store:
1. type 2. description
Default constructor; initialize type and description to be: type=4, description="Private passenger vehicle";
Constructor with parameters set type and description according to the parameters. post: type=t; description=d;
Function to set type and description according to the parameters. post: type=t; description=d;
Functions to return type and description data members. post: type; description;
Function to output type and description in the form: type description (e.g.,7Buses)
Note: Use the following guide table for license types and their descriptions:
1 w All types of motorcycles
2 w Construction vehicle
3 w Agricultural vehicle
4 w Private passenger vehicle
5 w Commercial passenger vehicle
6 w Minibus
7 w Buses
8 w Trailer and semi-trailer
9 w vehicle equipped for disabled
LicenseRestrictions:
Data members to store:
1. number 2. restrictions
Default constructor; initialize number and restriction to be: number=0, restriction="";
Constructor with parameters set number and restriction according to the parameters. post: number=n; restriction=r;
Function to set number and restriction according to the parameters. post: number=n; restriction=r;
Functions to return number and restriction data members. post: number; restriction;
Function to output number and restriction in the form: number restriction (e.g.,4Disabled)
Note: Use the following guide table for numbers and their corresponding restrictions:
Default constructor; initialize number and restriction to be: number=0, restriction="";
Constructor with parameters set number and restriction according to the parameters. post: number=n; restriction=r;
Function to set number and restriction according to the parameters. post: number=n; restriction=r;
Functions to return number and restriction data members. post: number; restriction;
Function to output number and restriction in the form: number restriction (e.g.,4Disabled)
Note: Use the following guide table for numbers and their corresponding restrictions:
1 w Glasses
2 w Earphones
3 w Automatic
4 w Disabled
5 w Lenses
6 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.
(2) 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 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 Programming Questions!