Hi. Every week at University my class are set a set of tasks to complete for the next week. However, this week it snowed very heavily and the lecture for my Java module was cancelled, so I didn't receive any help on how to solve this weeks'...
Hi.
Every week at University my class are set a set of tasks to complete for the next week. However, this week it snowed very heavily and the lecture for my Java module was cancelled, so I didn't receive any help on how to solve this weeks' tasks. So this is an SOS to those out there who know what they're doing.
This is the first task:
Quote:
A computer program is to be developed to be used in clocks. Here is a class definition for this program public class Time
{
public int hour;
public int minute;
public boolean isMorning;
}
Enhance the above class definition by providing two constructors: one that allows a time to be set to given values; and another that sets a default time of 1 O’clock in the morning.
I literally have no idea what to do with the boolean line.
And this is the second task:
Quote:
Write a program that uses the Time class you created above and creates two time objects, one which is initialised to 3.45 pm and one that uses the default constructor.
After reading a text book I believe that I may know how to create the object that initialises the time to 3:45pm, but any solutions are appreciated.
I apologize for the constant help I seek, and this isn't even my final project of the year.
I hope that if anyone has any spare time and knows what they're talking about that you can save me.
Apologies once again and thanks in advance 