Writing a program that computes the average salary

Assignment Help JAVA Programming
Reference no: EM13809699

The first programming project involves writing a program that computes the average salary for a collection of employees of different types. This program consists of four classes. The first class is the Employee class, which contains the employee's name and monthly salary, which is specified in whole dollars. It should have two methods:

  1. A constructor that allows the name and monthly salary to be initialized.
  2. A method named annualSalary that returns the salary for a whole year.

The Employee class has two subclasses. The first is Salesman. It has an additional instance variable that contains the annual sales in whole dollars for that salesman. It should have the same two methods:

  1. A constructor that allows the name, monthly salary and annual sales to be initialized.
  2. An overridden method annualSalary that returns the salary for a whole year. The salary for a salesman consists of the base salary computed from the monthly salary plus a commission. The commission is computed as 2% of that salesman's annual sales. The maximum commission a salesman can earn is $20,000.

The second subclass is Executive. It has an additional instance variable that reflects the current stock price. It should have the same two methods:

  1. A constructor that allows the name, monthly salary and stock price to be initialized.
  2. An overridden method annualSalary that returns the salary for a whole year. The salary for an executive consists of the base salary computed from the monthly salary plus a bonus. The bonus is $30,000 if the current stock price is greater than $50 and nothing otherwise.

Finally there should be a fourth class than contains the main method. It should create an array of objects of type Employee and initialize them to a mixture of different kinds of employees. It should then compute and display the average salary for all employees.

Be sure to follow good programming style, which means making all instance variable private and naming all constants. Furthermore you must select enough different kinds of employees to completely test the program.

Reference no: EM13809699

Questions Cloud

Compare and contrast three scripting languages : For this project, students will compare and contrast three scripting languages, the approaches, and techniques used in each to facilitate interactive design
Then write an essay about kenyon college commencement speech : Then write an essay about the sprrch "Kenyon College Commencement Speech"
Design a linear algorithm : The Russian flag problem is to rearrange an array of characters R, W, and B so that R is the first character, R is followed by a W, W is followed by a B, B is followed by another R, and the pattern repeats. Design a linear algorithm (pseudo code)..
Developmental analysis instructions : Developmental Analysis Instructions
Writing a program that computes the average salary : The first programming project involves writing a program that computes the average salary for a collection of employees of different types. This program consists of four classes
Examples of inventory control systems tools : Provide 3 examples of inventory control systems tools. Explain what these tools are and how they are used.
What does a curved message call line do : Describe sequence diagrams. Include in your discussion how to read them. What does a curved message call line do
Create an example inventory : The warehouse manager asked you to create an example inventory list for his staff. The inventory list is a comprehensive chart that lists all of the company's internal resources: equipment, machines, technology, furniture, office supplies, etc.
Cross-cultural comparison : CROSS-CULTURAL COMPARISON

Reviews

Write a Review

JAVA Programming Questions & Answers

  Pacman style game with clara

The major assignment involves producing a Pacman style game with Clara using the Greenfoot files that are given to you.

  Difference between the two following statements

What exactly is the difference between the two following statements and which is preferred, please provide details: 1) frame.setSize(400, 300); // Set JFrame Size

  1 securityimplement security so that all users can view the

1. security.implement security so that all users can view the information about the projects but only authenticated

  Write a recursive program to compute the number of ways in

write a recursive program to compute the number of ways in which an integer k can be written as sum each of whose

  Write a program counter.java that is a thread

Write a program Counter.java that is a Thread that counts up to a limit with random pauses in between each count.

  Determine the number of quarters

Read in a sum of money and determine the number of quarters, dimes, pennies and nickels represented in the cents portion.  You must get an optimal mix; all pennies, for example, is not allowed.

  Java program to find a value at in index

Construct a main class named Array Program that generates an array of 50-integers, all ranging from one to one hundred.

  Write function in javascript to compute person-s gross pay

Write the function using JavaScript syntax to compute a person's gross pay for a week. The function should receive the number of hours worked and the rate of pay per hour.

  Write a program that lets the user click on the panel

Write a program that lets the user click on the panel to dynamically create points. Initially, the panel is empty. When a panel has two or more points, highlight the pair of closest points. Whenever a new point is created, a new pair of closest po..

  What is the starting index of an array

What are your concerns? In Java, what is the starting index of an array

  Packer logo method

Being a super Packer fan's wife, this assignment involves the use of the Green Bay Packer logo. Any die-hard Minnesota fans are welcome to use the Viking's logo instead.

  Write a class house that correctly compiles and runs

Write a class House that correctly compiles and runs with the following TestHouse code. You cannot change a single thing in the TestHouse class,

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd