1) Write a method that receives two int parameters and returns the smaller
of the two values. Call your method getSmaller.
2) Write a method that receives two String objects and returns true if the
two Strings start with the same character (ignoring case) and false
otherwise.
3) Using the Die class, write a method that will use two Die, roll them
100 times and return the number of times that the sum of the two is
7 or 11.
For questions 4 and 5, write the requested portions of a class called Employee.
4) An Employee will have a name, social security number, position, and
hourly wages. Define the instance data for this class.
5) Write a method that is passed the int value of the number of hours worked
for the week as a parameter, and returns the pay for the Employee,
including overtime, which is 1.5 * hourly wages for each hour over 40.
1) The behavior of an object is defined by the object’s
a) instance data
b) constructor
c) visibility modifiers
d) methods
e) all of the above
2) The relationship between a class and an object is best described as
a) classes are instances of objects
b) objects are instances of classes
c) objects and classes are the same thing
d) classes are programs while objects are variables
e) objects are the instance data of classes
3) To define a class that will represent a car, which of the following definitions is
most appropriate?
a) private class car
b) public class car
c) public class Car
d) public class CAR
e) private class Car
4) Which of the following reserved words in Java is used to create an instance of a class?
a) class
b) public
c) public or private, either could be used
d) import
e) new