Use vi and the command-line to complete this program.
Write a class called TimeEntry that represents an entry in a time sheet. We will discuss this in class before you start.
Your TimeEntry class should have 3 attributes:
- timestamp - make this of class Date (what should you do to learn about the Date class?)
- hoursWorked - what datatype should this be?
- comments - what datatype should this be?
Methods:
- Write a default constructor - what should it set each attribute to?
- Write a getter for each attribute.
- Write a setter for each attribute.
- Write a basic toString().
Write a program called TestTimeEntry to test your new class:
More Notes:
Here is the signature to use for your toString() method in the TimeEntry class:
public String toString()
Note: You should use this signature to write toString() for every helper class you ever write.
In your TestTimeEntry program, use this statement to display your TimeEntry object (called timeEntry below):
System.out.println(timeEntry);
Turn in both of your source files via Canvas.