JAVA help
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).
12 years ago 20
Purchase the answer to view it
- Which type of constant multiplier is most appropriate for calculating rates? (Points : 2) 100, 10,000, or 100,000 1,3,5,7,10 Multiples of 5 Multiples of...
- Psychology Expert
- Change Management: Change Communication (A-plus Writer)
- MATH 126 week 1 DQs
- MATH 126 Ashford Entire Course Week 1-5 GRADE A++..
- BSHS 302 Week 3 - DQ 1 and DQ 2
- âWrite a feature article about a famous person explaining why you have such strong view about this person.â 700 words âThe...
- 2000 words method for paper
- 4 - 5 page Case Study: Colony Collapse Disorder in Honeybee Populations
- ACC 205 Week 2 DQ 1