Ask Chemistry Expert

Salaries for a buisness

You are assigned the task of creating a program for your boss that will help him keep track of his employee's salaries and ensure that an employee is not entering their salary twice.  There are two types of employee's full time and part time.

Implement a superclass named Employee that contains a salary instance variable, a getSalary method, and a 1-parameter constructor. The getSalary method is a simple accessor method that returns the salary instance variable's value. The 1-parameter constructor receives a weeklywage parameter and assigns a value to the salary instance variable based on this formula:

            salary = weeklywage * 52;

Implement two classes named FullTime and PartTime; they are both derived from the Employee superclass. FullTime should contain a fullhours instance variable (the employees hours per week). PartTime should contain a parthours instance variable (the employees hours per week). The FullTime and PartTime classes should each contain a 2-parameter constructor, an equals method, and a display method. In the interest of elegance and maintainability, don't forget to have your subclass constructors call your superclass constructors when appropriate. The display method should print the values of all the instance variables within its class.

Provide a driver class that tests your three employee classes. Your driver class should contain this main method:

public static void main(String[] args)

{

  FullTime FullT1 = new FullTime(3000.00, 50);

  FullTime FullT2 = new FullTime(3000.00, 50);

  if (FullT1.equals(FullT2))

  {

            FullT1.display();

  }

  PartTime PartT1 = new PartTime(1500.00, 20);

  PartTime PartT2 = new PartTime(1500.00, 20);

  if (PartT1.equals(PartT2))

  {

            PartT1.display();

  }

} // end main

 

Output:

Full Time: Salary = $156000.00, Hours worked per week = 50

Part Time: Salary = $78000.00, Hours worked per week = 20

Chemistry, Academics

  • Category:- Chemistry
  • Reference No.:- M91696190
  • Price:- $30

Priced at Now at $30, Verified Solution

Have any Question?


Related Questions in Chemistry

Question 1bonding energyi draw an energy level diagram for

Question 1: Bonding Energy i. Draw an energy level diagram for a single Na ion and Cl ion. ii. Explain what is happening to the energy level between these two ions in terms of the Potential Energy. iii. Which process uti ...

Wat is the molarity to the hundredths place of 50 g hpo3

What is the molarity, to the hundredths place, of 5.0 g HPO3 in 300. mL of solution?

Describe how to assign anbspoxidation number from

Describe how to assign a Oxidation number from the text: The oxidation number of an atom in an elemental substance is zero. The oxidation number of a monatomic ion is equal to the ion's charge. Oxidation numbers for comm ...

How many grams of h2so4 must be dissolved into 0709 l of

How many grams of H2SO4 must be dissolved into 0.709 L of solution to generate a concentration of 0.303 M?

What could a source of error be during a titration lab that

What could a source of error be during a titration lab that is not a humans fault?

How many moles of magnesium ion are present in 525g

How many moles of magnesium ion are present in 5.25g Mg 3 (PO 4 ) 2 ?

What is the volume of a solution with a concentration of 12

What is the volume of a solution with a concentration of 1.2 M that contains 12 g of NaOH?

What is the molarity of a solution made by dissolving 200 g

What is the molarity of a solution made by dissolving 20.0 g of CrCl2 in 0.150 L of solution?

What is the mass of naoh present in grams given that a 100

What is the mass of NaOH present in grams, given that a 100. mL solution has a concentration of 0.125 M?

What is the volume of a solution in milliliters that

What is the volume of a solution, in milliliters, that contains 1.5 g LiNO3 and has a concentration of 0.40 M?

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As