Directions: Fill in answers on the pages below. Don't spend too much time on any one problem.
double temperature = 98.6; // put the rest of the code below
String s1 = "Joe"; String s2 = "Moe"; // put the rest of the code below
int minutes = 217; // put the rest of the code below
The Employee class has private data members (called instance variables in the lectures) giving an employee's
There are "get" methods to return each of these fields.
There is one constructor, which takes a name, hours worked, and hourly rate as formal parameters.
There is a method calculateWages, which uses the values of myHoursWorked and myHourlyRate to calculate a value for myWages. The amount of wages is just the hours times the rate, except that you must pay time and a half for all hours worked over 40. There are several different ways that this method can be written and used, so that there is no single correct answer (although of course there is a correct numerical answer).
There should also be a toString method.
You will be filling in the blanks below to complete the Java implementation of this class:
public class Employee {
// fill in the data members (also known as instance variables) below
// fill in the constructor below
// fill in the accessor methods below
// fill in the calculateWages method below
// fill in the toString method below
}
public class EmployeeTest {
public static void main (String[] args) {
}
}