CISP400 Assignment Object Oriented Programming with C++

Added on - 09 Oct 2019

  • 11

    pages

  • 3728

    words

  • 12

    views

  • 0

    downloads

Showing pages 1 to 4 of 11 pages
You can choose to submit either A4 (worth 150 points), AD4 (worth 180), or both (worth 180) for 4thassignment 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 Microsoftvisual studio 2013 C++ compiler, the assignment will not get anycredit.2.If the file name does not follow the naming instruction as stated insyllabus, the assignment will get 5 to 15 points deduction.3.If the header section of the submitted file does not include personalinformation and purpose of the file, the assignment will get 5 to 30points deduction.4.Late assignments will not get any credit for the assignment.5.A submission does not follow the instructions of the assignment willget little credit.6.A portion of the assignment is not finished or incomplete will get littleor no credit.7.Submit an assignment to a wrong drop box. The wrong drop box onewill not get any credit.8.If use A for AD or AD for A assignments in the file name, the studentwill 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 littlecredit.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, theprogram will get little credit.12.If the displaying result of the program is not exactly match withthe graphic in the assignment description or the displaying result ofthe executable file which comes with the assignment, the assignmentwill get little credit.Page1of11CISP400V9A4
13.If the program does not have enough detail documentation inthe programming area the program will get 5 to 30 points deduction.14.If the program includes some unrelated documentation theprogram 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 objectshould 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, atick member function that increments the time stored in a Date object by one second, andincreaseADay function to increase day, month and year when it is proper. Please useCISP400V9A4.cpp that tests the tick member function in a loop that prints the time in standard formatduring iteration of the loop to illustrate that the tick member function works correctly. Be aware thatwe 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 defaultvalues. It also displays "Time object constructor is called." message and calls printStandardand printUniversal functions.2.The setTime function takes three integers but does not return any value. It initializes theprivate data members’ (hour, minute and second) data.3.The setHour function takes one integer but doesn’t return anything. It validates and stores theinteger to the hour private data member.4.The setMinute function takes one integer but doesn’t return anything. It validates and storesthe integer to the minute private data member.Page2of11CISP400V9A4
5.The setSecond function takes one integer but doesn’t return anything. It validates and storesthe integer to the second private data member.6.The getHour constant function returns one integer but doesn’t take anything. It returns theprivate data member hour’s data.7.The getMinute constant function returns one integer but doesn’t take anything. It returns theprivate data member minute’s data.8.The getSecond constant function returns one integer but doesn’t take anything. It returns theprivate 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 inuniversal-time format.11.The printStandard constant function does not return or accept anything. It displays time instandard-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 checkDayfunction.1.The Date function is a default constructor. It takes 3 integers and one Time object. Thethree integers have default data (1, 2, and 1900) and the Time has (0, 0, and 0) as defaultdata. It displays "Date object constructor for date" information when the constructor iscalled.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 datamember day by one. It also checks the day to make sure the data is accurate. If the data isnot 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 objectof the Date class private data member. This function has to make sure that the secondincreased is proper or it will adjust all the necessary corresponding data.Page3of11CISP400V9A4
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 ofday, month, and year information. This utility function to confirm proper day value basedon 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 anexecutable file. You can double click the file to get to the expecting result (see the picture below) ofthis assignment. The Date.cpp, Date.h, Time.cpp, and Time.hare files coming from the textbookexamples which you can use so you don’t need to start from scratch. After you finish yourimplementation for theDateand Time class, you can put the CISP400V9A4.cpp, Date.cpp, Date.h,Time.cpp, and Time.hin 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) togenerate 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 nextcolumn is the beginningsection of the display.Page4of11CISP400V9A4
desklib-logo
You’re reading a preview
card-image

To View Complete Document

Become a Desklib Library Member.
Subscribe to our plans

Unlock This Document