1. For the following problem statement, would you include an if/else statement or a switch statement? Explain your answer. Be sure to address both types of statements in your answer. (You do not need to write the code.)
Write a program that determines the bonus that should be paid to employees. Bonuses are determined based on the year’s production. The bonus is $25 for 1000 units or fewer. The bonus is $50 for 1001 to 3000 units. The bonus is $100 for 3001 units or more.
2.Given the following class header, what method do you expect to see in this class as a result of implements ActionListner and why?
public class NameCompare extends JFrame implements ActionListener
3.What would be printed from the following code?
public static void main(String[] args)
{
int m = 57;
m %= 5;
System.out.println("The value of m is: " + m);
}
4.Use the following partial class definition to answer the next five questions.
Write a constructor for the Table class that will accept two input arguments (color and numberofLegs) as the initial values of the attributes/data members.
5.Write an overloaded constructor for the Table class that takes a single argument for the color of the table.
6.Write a set method (also known as a “setter” or a “mutator”) method for the color attribute.
7.Write a get method (also known as a “getter” or an “accessor”) for the color attribute.
8.Write a main method that will accomplish the following:
(You may assume the the class includes appropriate setter methods and getter methods. The output can be completed using either console output or GUI output).
1. Create a blue kitchen table with 4 legs
2. Create a brown dinning table with 6 legs
3. Change the color of the kitchen table to be pink
4. Print out the color of the dining table including text identifying which value you are printing and also the value itself.
5. Print out the number of tables including text identifying which value you are printing and also the value itself.
9.Write a method that meets the requirements of the following comment header block.
10.Write a method that meets the requirements of the following comment header block.
This method should use the method created in the previous problem. You may use either console or GUI output.
11.Write a method named compareNames that will determine if two names are the same. The two names will be the input arguments to the method. The method should return whether the names are the same or not.
12.Write a main method that will use the method in the previous problem to determine if two names entered at the keyboard are the same. Once the decision has been made the main method must display both names and whether or not the names are the same. You may use either console input/output or JOptionPane input / message dialog output (GUI input / output).