i missed lecture today and this is what they did in class. im not sure how to complete this. hope you all can help me out.
class Clock
{
// Declare fields of the class
// 0 <= hours < 24, 0 <= minutes < 60, 0 <= seconds < 60
private int hours, minutes, seconds;
Clock(int hh, int mm, int ss) //constructor
{
}
//increase time by sec seconds
public void incrementSeconds(int sec)
{
}
//increase time by min minutes
public void incrementMinutes(int min)
{
}
//increase time by hh hours,
//if hours reach 24, simply wrap around to 0.
public void incrementHours(int hh)
{
}
public void addTime(Clock C) //add C into the clock
{
}
//print time in hours:minutes:seconds am(or pm) format
public void printTime()
{
}
}
class ClockDemo
{
public static void main(String [] args)
{
//write each statement for each operation below
(create Clock object C1 with h:m:s = 0:0:0)
(create second Clock object C2 with h:m:s=12:35:59)
(add C2 into C1)
(print C1)
(print C2)
(increase clock C1 by 1 seconds)
(print C1)
(increase clock C1 by 100 minutes)
(print C1)
(increase clock C1 by 10 hours)
(print C1)
(print C2)
}
}