Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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 //dont 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.

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_2

Step: 3

blur-text-image_3

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

Oracle 12c SQL

Authors: Joan Casteel

3rd edition

1305251032, 978-1305251038

More Books

Students also viewed these Databases questions