Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

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

For each of the following reactions identify the oxidizing

For each of the following reactions identify the oxidizing agent and the reducing agent. 2Na(aq)+2H2O(l)→2NaOH(aq)+H2(g) C(s)+O2(g)→CO2(g) 2MnO-4(aq)+5SO2(g)+2H2O(l)→2Mn2+(aq)+5SO2-4(aq)+4H+(aq)

Does dissolved solids such as sugar and salt modifychange

Does dissolved solids such as sugar and salt modify/change the boiling point of water; do mixtures have the same boiling point as pure substances?

A mixture containing 33 moles of no and 076 mole

A mixture containing 3.3 moles of NO and 0.76 mole ofCO 2  was allowed to react in a flask at a certaintemperature according to the equation. NO (g) + CO 2  (g) ↔ NO2 (g) + CO (g) At equilibrium 0.21 mole of CO 2  was pr ...

At rest a person inhales 9721021 nitrogen molecules in an

At rest, a person inhales 9.72*10^21 nitrogen molecules in an average breath of air. How many mole of nitrogen atoms are inhaled? (Hint: in air, nitrogen occurs as a diatomic molecule)

1 potassium hydrogen phthalate is a solid monoprotic acid

1. Potassium hydrogen phthalate is a solid, monoprotic acid frequently used in the laboratory as a primary standard. It has the unwieldy formula of  KHC 8 H 4 O 4 . This is often written in shorthand notation as KHP. If  ...

A chemist must preparenbsp725 ml ofnbsp275 mm aqueous

A chemist must prepare 725. mL of 275. mM aqueous copper(II) sulfate CuSO4 working solution. He'll do this by pouring out some 0.316 M aqueous copper(II) sulfate stock solution into a graduated cylinder and diluting it w ...

Q1 in your gravimatric analysis experiment you weigh the

Q1: In your gravimatric analysis experiment, you weigh the precipitate of AgCl in a filtering crucible. You have to weight your filtering crucible first (three weighing measurement), then do the filtration. After drying ...

1 consider the reaction when aqueous solutions

1. Consider the reaction when aqueous solutions of  nickel(II) bromide  and  sodium carbonate  are combined. The net ionic equation for this reaction is: 2. Net ionic equation for the reaction that occurs when aqueous so ...

A power plant converts the heat energy in coal to

A power plant converts the heat energy in coal to electricity with 35% efficiency. Transmission losses are 10%. A factory then uses that electricity to make hydrogen with 50% efficiency, which is used in a fuel cell to m ...

A 200 ml sample of 0200 m hbr solution is titratedwith 0200

A 20.0 mL sample of 0.200 M HBr solution is titratedwith 0.200 M NaOH solution. Calculate the pH of the solution after the following volumes of base have been added. (19.8 mL)

  • 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