Answered step by step
Verified Expert Solution
Link Copied!

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

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.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Learning MySQL Get A Handle On Your Data

Authors: Seyed M M Tahaghoghi

1st Edition

0596529465, 9780596529468

More Books

Students also viewed these Databases questions