logo

CISP400 Assignment Object Oriented Programming with C++

11 Pages3728 Words429 Views
   

Object Oriented Programming with C++ (CISP400)

   

Added on  2019-10-09

CISP400 Assignment Object Oriented Programming with C++

   

Object Oriented Programming with C++ (CISP400)

   Added on 2019-10-09

ShareRelated Documents
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 programmingfiles to run the program, the program will get little credit.11.If the program does not separate into several files (driver, headerfile, 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 the executable file which comes with the assignment, the assignment will get little credit. Page 1 of 11CISP400V9A4
CISP400 Assignment Object Oriented Programming with C++_1
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.A4Modify 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 classThe 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.4.The setMinute function takes one integer but doesn’t return anything. It validates and stores the integer to the minute private data member.Page 2 of 11CISP400V9A4
CISP400 Assignment Object Oriented Programming with C++_2
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 classThe 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.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.Page 3 of 11CISP400V9A4
CISP400 Assignment Object Oriented Programming with C++_3
5.The ~Date function is a destructor of the Date class. It also displays "Date object destructoris 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 11CISP400V9A4
CISP400 Assignment Object Oriented Programming with C++_4

End of preview

Want to access all the pages? Upload your documents or become a member.

Related Documents
Object Oriented Programming with C++ CISP400
|10
|3182
|386

Assignment CISP400 Object Oriented Programming with C++
|11
|3830
|198

CISP400 Object Oriented Programming with C++ Assignment
|10
|2009
|76

Assignment on CISP400 Object Oriented Programming with C++
|6
|2031
|364

CISP400 Object Oriented Programming with C++
|12
|2105
|260