INFO XXXXXXXXXXAssignment 7 So in this assignment you will begin with the starterProject I provide and then add to it. I am also asking that before you begin you really look at the starterProject...

Heading is MungerHeading. Assignment name is MungerAssignment7



INFO 1521 - Assignment 7 So in this assignment you will begin with the starterProject I provide and then add to it. I am also asking that before you begin you really look at the starterProject because this is the object-oriented basics. The starterProject is the exact same as the ClassClockExample.zip in Week 7. Again, this is done this using a clock because it is something that you already know how it works. Remember that OOD and OOP is an organizational change from the functional programming method. This is because we could create a clock without using OOP and it would work. You will create another class called dateTime. See below for the details. Then you will inherit the clock class and the dateTimeApp will test it. Requirements: 1. Your dateTime.java must be the class and inherit the clock class. 2. Your dateTimeApp.java is the main program. 3. You will create the following public member functions for the dateTime class. a. dateTime() //Default constructor with parameters //Post: date is set to 1-1-2000 //day = 1; month = 1; year = 2000 //don’t forget to call the default constructor for the //the clock class. b. dateTime(int day, int month, int year, int hours, int minutes, int seconds) //Constructor with parameters //Post: The date and time is set according to //the parameters //The day, month and year get validated and set //The hours, minutes and seconds get passed on to the clock //constructor c. void setDate(int day, int month, int year) //Function to set the date //Post: time is set according to the //parameters void setTime(int hours, int minutes, int seconds) //Function to set the time //Post: time is set according to the //parameters d. void printTime() //Function to print the time //Time is printed in the form hh:mm:ss e. void printDate() //Function to print the date //Date is printed in the form day-month-year f. void printDateTime() //Function to print the time //Date and then Time is printed in the form //day-month-year hh:mm:ss g. void incrementSeconds() *should still work //Function to increment the time by 1 second //Post: The time is incremented by 1 second //If the before-increment time is 23:59:59, the time //is reset to 00:00:00 h. void incrementMinutes() ***should still work //Function to increment the time by 1 minute //Post: The time is incremented by 1 minute //If the before-increment time is 23:59:53, the time //is reset to 00:00:53 i. void incrementHours() ***should still work //Function to increment the time by 1 hour. //Post: The time is incremented by 1 hour. //If the before-increment time is 23:45:53, time //is reset to 00:45:53 j. bool equalTime(dateTime otherClock) ***should still work //Function to compare the two times //Function returns true if this time is equal to //otherClock; otherwise it returns false k. void incrementDays() //Function to increment the date by 1 day //Post: The time is incremented by 1 day //If the before-increment date is 31-12-2009, the date //is reset to 1-1-9010 l. void incrementMonths() //Function to increment the date by 1 month //Post: The month is incremented by 1 month //If the before-increment date is 31-12-2009, the date //is reset to 31-1-9010 m. void incrementYears() //Function to increment the date by 1 year. //Post: The year is incremented by 1 year. n. bool equalDate(dateTime otherDate) //Function to compare the two dates //Function returns true if this date is equal to //otherwise it returns false 4. The dateTimeApp will then run the clock and the date. You need to test all of the functionality you have built in. 5. Be sure you also update or change the header file to yours. INFO 1521 - StarterProject The following is what I might have given you if I wanted you to create the starterProject. “You are going to create a clock in this project and use a class while doing it. So the class will be the clock called Clock.java and then you will have another JAVA file that runs it called ClockApp.java. Below are the requirements for the clock and the clockapp that runs it. “ Requirements: 1. Your Clock.java must be the class. 2. Your ClockApp.java is the main program. 3. Your clock will be a 24 hour clock 4. You will create the following public member functions for the clock class. a. clock() //Default constructor with parameters //Post: time is set to 00:00:00 //hr = 0; min = 0; sec = 0 b. clock(int hours, int minutes, int seconds) //Constructor with parameters //Post: The time is set according to //the parameters //hr = hours; min = minutes; sec = seconds c. void setTime(int hours, int minutes, int seconds) //Function to set the time //Post: time is set according to the //parameters: hr = hours; min = minutes; sec = seconds d. void printTime() //Function to print the time //Time is printed in the form hh:mm:ss e. void incrementSeconds() //Function to increment the time by 1 second //Post: The time is incremented by 1 second //If the before-increment time is 23:59:59, the time //is reset to 00:00:00 f. void incrementMinutes() //Function to increment the time by 1 minute //Post: The time is incremented by 1 minute //If the before-increment time is 23:59:53, the time //is reset to 00:00:53 g. void incrementHours() //Function to increment the time by 1 hour. //Post: The time is incremented by 1 hour. //If the before-increment time is 23:45:53, time //is reset to 00:45:53 h. bool equalTime(const clockType otherClock) //Function to compare the two times //Function returns true if this time is equal to //otherClock; otherwise it returns false 5. The ClockApp will then run the clock. You need to test all of the functionality you have built in. 6. Don’t forget your header file 7. While testing the functionality create a loop and increment the seconds for a while.
Feb 12, 2021
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here