CISP400V9 A4 and AD4 Programming Assignment

Verified

Added on  2019/10/09

|11
|3728
|429
Homework Assignment
AI Summary
This document outlines two programming assignments, A4 and AD4, for the CISP400V9 course. Both assignments involve modifying and extending C++ classes related to time, date, and employee information. Assignment A4 focuses on integrating Time and Date classes, including a tick function for time increments. Assignment AD4 builds upon A4 by adding a DateTime class and an Employee class, requiring the implementation of various functions and interactions between these classes. The assignments come with starter files and executable examples, and students are expected to document their code and submit it in a specific format. Detailed grading criteria are provided, emphasizing code functionality, adherence to instructions, and proper documentation.
Document Page
You can choose to submit either A4 (worth 150 points), AD4 (worth 180), or both (worth 180) for 4th
assignment you will get a score for this assignment either 150 points base or 180 points base.
Grading Criteria:
1. If the submitted program cannot be compiled or run on a Microsoft
visual studio 2013 C++ compiler, the assignment will not get any
credit.
2. If the file name does not follow the naming instruction as stated in
syllabus, the assignment will get 5 to 15 points deduction.
3. If the header section of the submitted file does not include personal
information and purpose of the file, the assignment will get 5 to 30
points deduction.
4. Late assignments will not get any credit for the assignment.
5. A submission does not follow the instructions of the assignment will
get little credit.
6. A portion of the assignment is not finished or incomplete will get little
or no credit.
7. Submit an assignment to a wrong drop box. The wrong drop box one
will not get any credit.
8. If use A for AD or AD for A assignments in the file name, the student
will not get any credit for the assignments.
9. If the submitted file(s) cannot be opened by the instructor’s software
(WinZip, Visual Studio, or text editor) the assignment will have little
credit.
10. If the submission file does not include all necessary programming
files to run the program, the program will get little credit.
11. If the program does not separate into several files (driver, header
file, implementation file, etc.) as describe in the assignment, the
program will get little credit.
12. If the displaying result of the program is not exactly match with
the graphic in the assignment description or the displaying result of
Page 1 of 11 CISP400V9A4
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
the executable file which comes with the assignment, the assignment
will get little credit.
13. If the program does not have enough detail documentation in
the programming area the program will get 5 to 30 points deduction.
14. If the program includes some unrelated documentation the
program will get some points deduction.
A4
Modify the Time class of Figs. 9.4–9.5(attached) to be able to work with Date class. The Time object
should always remain in a consistent state.
Modify the Date class of Figs. 9.17- 9.18(attached) to include a Time class object as a composition, a
tick member function that increments the time stored in a Date object by one second, and
increaseADay function to increase day, month and year when it is proper. Please use
CISP400V9A4.cpp that tests the tick member function in a loop that prints the time in standard format
during iteration of the loop to illustrate that the tick member function works correctly. Be aware that
we are testing the following cases:
a) Incrementing into the next minute.
b) Incrementing into the next hour.
c) Incrementing into the next day (i.e., 11:59:59 PM to 12:00:00 AM).
d) Incrementing into the next month and next year.
Time class
The Time class has three private integer data members, hour (0 - 23 (24-hour clock format)), minute (0
– 59), and second (0 – 59).
It also has Time, setTime, setHour, setMinute, setSecond, getHour(), getMinute, getSecond,~Time,
printUniversal, and printStandard public functions.
1. The Time function is a default constructor. It takes three integers and they all have 0 as default
values. It also displays "Time object constructor is called." message and calls printStandard
and printUniversal functions.
2. The setTime function takes three integers but does not return any value. It initializes the
private data members’ (hour, minute and second) data.
3. The setHour function takes one integer but doesn’t return anything. It validates and stores the
integer to the hour private data member.
Page 2 of 11 CISP400V9A4
Document Page
4. The setMinute function takes one integer but doesn’t return anything. It validates and stores
the integer to the minute private data member.
5. The setSecond function takes one integer but doesn’t return anything. It validates and stores
the integer to the second private data member.
6. The getHour constant function returns one integer but doesn’t take anything. It returns the
private data member hour’s data.
7. The getMinute constant function returns one integer but doesn’t take anything. It returns the
private data member minute’s data.
8. The getSecond constant function returns one integer but doesn’t take anything. It returns the
private data member second’s data.
9. The Time destructor does not take anything. It displays "Time object destructor is called."
message and calls printStandard and printUniversal functions.
10. The printUniversal constant function does not return or accept anything. It displays time in
universal-time format.
11. The printStandard constant function does not return or accept anything. It displays time in
standard-time format.
Date class
The Date class has three private integer data members (month, day and year), one private Time object
(time) data member and one static constant integer variable (monthsPerYear).
It has Date, print, increaseADay, tick, and ~Date public functions. It has one private checkDay
function.
1. The Date function is a default constructor. It takes 3 integers and one Time object. The
three integers have default data (1, 2, and 1900) and the Time has (0, 0, and 0) as default
data. It displays "Date object constructor for date" information when the constructor is
called.
2. The print constant function does not take or return data. It prints out the month day year,
hour, minute and second information.
3. The increaseADay function does not take or return data. It increases the private data
member day by one. It also checks the day to make sure the data is accurate. If the data is
not accurate it will adjust all the necessary corresponding data.
Page 3 of 11 CISP400V9A4
Document Page
4. The tick function does not takes or return data. It increases one second to the Time object
of the Date class private data member. This function has to make sure that the second
increased is proper or it will adjust all the necessary corresponding data.
5. The ~Date function is a destructor of the Date class. It also displays "Date object destructor
is called "; message and calls Time object destructor.
6. The constant checkDay function takes and returns an integer. It makes sure the accuracy of
day, month, and year information. This utility function to confirm proper day value based
on month and year, it also handles leap years, too.
This assignment comes with a CISP400V9A4.zip file. It includes six files (CISP400V9A4.cpp,
CISP400V9A4.exe, Date.cpp, Date.h, Time.cpp and Time.h). The CISP400V9A4.exe file is an
executable file. You can double click the file to get to the expecting result (see the picture below) of
this assignment. The Date.cpp, Date.h, Time.cpp, and Time.h are files coming from the textbook
examples which you can use so you don’t need to start from scratch. After you finish your
implementation for the Date and Time class, you can put the CISP400V9A4.cpp, Date.cpp, Date.h,
Time.cpp, and Time.h in a project and then you can run to the same result as the CISP400V9A4.exe.
Please be awarded that you can adjust only your program (Date.cpp, Date.h, Time.cpp and Time.h) to
generate the required result but not the code in CISP400V9A4.cpp file.
The following are the couple displays of the expecting results.
The picture in the next
column is the beginning
section of the display.
Page 4 of 11 CISP400V9A4
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
The picture in the next
column is the ending
section of the display.
Please document CISP400V9A4.cpp, Date.cpp, Date.h, Time.cpp, and Time.h files properly and zip them
into a proper named zip file for an assignment (refer to the assignment section of the class syllabus) and submit
it to the A4 dropbox of the D2L Website.
Worth 150 points
AD4.
Modify the Time class of Figs. 9.4–9.5 (attached) to work with Date class, Date time class and
employee class. The Time object should always remain in a consistent state.
Modify the Date and Employee class of Figs. 9.17- 9.20 (attached) to work with other class in the
assignment.
Create DateTime class that includes a Time class object a composition, a tick member function that
increments the time stored in a Date object by one second, and increaseADay function to increase day,
month and year when it is proper.
In the CISP400V9AD4.cpp, we instantiate three Employee objects and assign them to the first three
elements of a 10 element Employee pointer array. Use for loop to print out the each Employee
object’s information before and after a set of training time.
The following is a description of each class.
Time class
Page 5 of 11 CISP400V9A4
Document Page
The Time class has three private integer data members, hour (0 - 23 (24-hour clock format)), minute (0
– 59), and second (0 – 59).
It also has Time, setTime, setHour, setMinute, setSecond, getHour(), getMinute, getSecond,~Time,
and printStandard public functions.
1. The Time function is a default constructor. It takes three integers and each has default value of
23, 59, and 58.
2. The setTime function takes three integers but does not return any value. It initializes the
private data members’ (hour, minute and second) data.
3. The setHour function takes one integer but doesn’t return anything. It validates and stores the
integer to the hour private data member.
4. The setMinute function takes one integer but doesn’t return anything. It validates and stores
the integer to the minute private data member.
5. The setSecond function takes one integer but doesn’t return anything. It validates and stores
the integer to the second private data member.
6. The getHour constant function returns one integer but doesn’t take anything. It returns the
private data member hour’s data.
7. The getMinute constant function returns one integer but doesn’t take anything. It returns the
private data member minute’s data.
8. The getSecond constant function returns one integer but doesn’t take anything. It returns the
private data member second’s data.
9. The Time destructor does not take anything.
10. The printStandard constant function does not return or accept anything. It displays time in
standard-time format.
Date class
The Date class has three private integer data members (month, day and year), and one static constant
integer variable (monthsPerYear).
It has Date, print, ~Date, setMonth, setYear, and setDay public functions. It has one private checkDay
function.
1. The Date function is a default constructor. It takes 3 integers. The three integers have
default data (1, 1, 1900).
Page 6 of 11 CISP400V9A4
Document Page
2. The print constant function does not take or return data. It prints out the month, day and
year information.
3. The ~Date function is a destructor of the Date class. It also displays "Date object destructor
is called "; message and calls Time object destructor.
4. The setDay function takes an integer and does not return anything. It validates the day
information by calling checkDay function and saves the validated information.
5. The setMonth function takes an integer and does not return anything. It validates the month
information and saves the validated information.
6. The setYear function takes an integer and does not return anything. It validates the year
information and saves the validated information. If year greater than 2020 or less than 1920
displays “invalid year and set to 2011’ information i
7. The constant checkDay function takes and returns an integer. It makes sure the accuracy of
day, month, and year information. This utility function to confirm proper day value based
on month and year, it also handles leap years, too.
DateTime class
The DateTime class has three private integer data members (month, day and year), one Time class
object (time) and one static constant integer variable (monthsPerYear).
It has DateTime, print, increaseADay, tick, getMonth, getYear, getDay, setMonth, setYear, setDay,
getHour, getMinute, getSecond, setHour, setMinute, setSecond, and ~DateTime public functions. It
has one private checkDay function.
1. The DateTime function is a default constructor. It takes 3 integers and a Time object
information. The three integers have default data of 0, 0, and 0. The Time object also has
0, 0, and 0 as default data.
2. The print constant function does not take or return data. It prints out the month, day, year
and Time object information.
3. The increaseADay function does not take or return data. It increases the private data
member day by one. It also checks the day to make sure the data is accurate. If the data is
not accurate it will adjust all the necessary corresponding data.
4. The tick function does not takes or return data. It increases one second to the Time object
of the DateTime class private data member. This function has to make sure that the second
increased is proper or it will adjust all the necessary corresponding data.
5. The getMonth function returns an integer but does not take anything. It returns the month
private data member.
Page 7 of 11 CISP400V9A4
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
6. The getYear function returns an integer but does not take anything. It returns the year
private data member.
7. The getDay function returns an integer but does not take anything. It returns the day
private data member.
8. The setDay function takes an integer and does not return anything. It validates the day
information by calling checkDay function and saves the validated information.
9. The setMonth function takes an integer and does not return anything. It validates the month
information and saves the validated information.
10. The setYear function takes an integer and does not return anything. It validates the year
information and saves the validated information. If year greater than 2020 or less than 1920
displays “invalid year and set to 2011’ information i
11. The getHour function returns an integer but does not take anything. It returns the hour
information of the Time object (time) private data member.
12. The getMinute function returns an integer but does not take anything. It returns the minute
information of the Time object (time) private data member.
13. The getSecond function returns an integer but does not take anything. It returns the second
information of the Time object (time) private data member.
14. The setHour function takes an integer but does not return anything. It validates the integer
and set the validated information to hour component of the Time object (time) private data
member.
15. The setMinute function takes an integer but does not return anything. It validates the
integer and set the validated information to minute component of the Time object (time)
private data member.
16. The setSecond function takes an integer but does not return anything. It validates the
integer and set the validated information to the second component of theTime object (time)
private data member.
17. The ~DateTime function is a destructor of the DateTime class.
18. The constant checkDay function takes and returns an integer. It makes sure the accuracy of
day, month, and year information. This utility function to confirm proper day value based
on month and year, it also handles leap years, too.
Page 8 of 11 CISP400V9A4
Document Page
The Employee class has two private string data members (firstName and lastName), two private Date
objects (hireDate and birthDate), two private DateTime objects (startDateTime and endDateTime), and
one private static integer (count). The count is used to count the existence of Employee object.
It has Employee, getFirstName, getLastName, gethireDate, getbirthDate, getstartDateTime,
getendDateTime, testZeroDateTime, setendDateTime, print, ~Employee, and getCount public
functions.
1. The Employee function is a default constructor. It takes 2 strings, two Date objects, and two
DateTime objects information.
2. The getFirstName function returns a string but does not take any data. It returns the private
data member firstName information.
3. The getLastName function returns a string but does not take any data. It returns the private
data member lastName information.
4. The gethireDate function does not take or returns any data. It displays the private data member
Date object hireDate information.
5. The getbirthDate function does not take or returns any data. It displays the private data
member Date object birthDate information.
6. The getstartDateTime function does not take or returns any data. It displays the private data
member DateTime object startDateTime information.
7. The getendDateTime function does not take or returns any data. It displays the private data
member DateTime object endDateTime information.
8. The testZeroDateTime function takes a DateTime object and returns a Boolean data. It testes
the passed in DataTime object whether the object contains all 0s in its data members. If yes
than return true otherwise return false.
9. The setendDateTime function takes three integers (hour, minute and second) but does not
return anything. It takes the integers of training time needed for each employee to update the
endDateTime object’s data members.
10. The print function does not take or return any data. It displays an Empolyee object’s
information. It shows employee’s first name last name, birth date, hire date, Training starts at,
and Training ends at. If there is not training time set yet then displays “No specified end
training date and time.”
11. The ~Employee is the destructor of the class.
12. The getCount static function does not take any data but return an integer. It returns the number
of existence of the Employee class objects.
This assignment comes with a CISP400V9AD4.zip file. It includes eight files (CISP400V9AD4.cpp,
CISP400V9AD4.exe, Date.cpp, Date.h, Time.cpp, Time.h, Employee.cpp, and Employee.h). The
Page 9 of 11 CISP400V9A4
Document Page
CISP400V9AD4.exe file is an executable file. You can double click the file to get to the expecting
result (see the picture below) of this assignment. The Date.cpp, Date.h, Time.cpp, Time.h,
Employee.cpp, and Employee.h are files coming from the textbook examples which you can use so
you don’t need to start from scratch. After you finish your implementation for the Date, Time,
DateTime, Employee classes, you can put the CISP400V9AD4.cpp, Date.cpp, Date.h, Time.cpp,
Time.h, DateTime.cpp, DateTime.h, Employee.cpp, and Employee.h in a project and then you can run
to the same result as the CISP400V9AD4.exe. Please be awarded that you can adjust only your
program (Date.cpp, Date.h, Time.cpp, Time.h, DateTime.cpp, DateTime.h, Employee.cpp, and
Employee.h) to generate the required result but not the code in CISP400V9AD4.cpp file.
The following is the display of the expecting result.
Please document CISP400V9AD4.cpp, Date.cpp, Date.h, Time.cpp, Time.h, DateTime.cpp,
DateTime.h, Employee.cpp, and Employee.h files properly and zip them into a proper named zip file for an
Page 10 of 11 CISP400V9A4
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
advance assignment (refer to the assignment section of the class syllabus) and submit it to the A4 dropbox of the
D2L Website.
Worth 180 points
Page 11 of 11 CISP400V9A4
chevron_up_icon
1 out of 11
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]