Write a program that computes the average salary

Assignment Help JAVA Programming
Reference no: EM13810358

Instructions

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: EM13810358

Questions Cloud

Writing a program to calculate state income tax : The second programming project involves writing a program to calculate state income tax for a single taxpayer that uses a GUI. The GUI should use the grid layout manager and should looks similar to the following: The salary income, interest income..
Average tax rate that firm pays or marginal tax rate firm : Regarding income taxes, which do you think is more important (and why)-- the average tax rate that a firm pays or the marginal tax rate the firm is paying?
Basic assumptions of the organization : Describe the artifacts you find or recall that define the culture of the organization. Indicate what these artifacts reveal to you about the shared values and basic assumptions of the organization you selected.
What is cost of equity raised by selling new common stock : Trahan Lumber Company hired you to help estimate its cost of common equity. You obtained the following data: D1 = $1.25; P0 = $27.50; g = 5.00% (constant); and F = 6.00%. What is the cost of equity raised by selling new common stock?
Write 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. The first class is the Employee class, which contains the employee's..
Perform a swot analysis of the organization : Provide a brief description of the company that you have selected and the product or service that you are analyzing. Discuss what quality means for this product. Perform a SWOT analysis of the organization.
Benefits and limitations to using interview as a methodology : What are some of the benefits and limitations to using interview as a research methodology
Which of these should cause the dollar to appreciate : Which of these should cause the dollar to appreciate?
Database modeling : After reading this week's article, "Modeling for the Future," expand on the subject of Database Modeling. There are several tools listed and reviewed in the article. Research these tools further, or identify other modeling tools

Reviews

Write a Review

JAVA Programming Questions & Answers

  Create an application for an animal-fur trimming service

create an application for an animal-fur trimming service. the business is open 15 weeks of the year from april through

  The reference to the abstract class

Explain what happens when the reference to the abstract class X is used to execute method M1( ). X obj = new Y( ); obj.M1( );

  Distributed systems

Build robust, secure distributed systems using advanced programming techniques

  Create a file that contains your favorite movie quote

Create a file that contains your favorite movie quote. Use a text editor such as Notepad, and save the file as quote.txt. Copy the file contents,

  Create a program in java that displays hello world

Create a program in Java that displays "Hello world!", No Design Section is required for this assignment, Copy and Paste your code into the Source Programs section and a screen shot of the results in the Output section.

  Determines if the input string is a valid lock combination

Write a Java program that satisfies the given requirement - Prompts the user to input exactly nine characters, which constitute a valid lock combination.

  Implements both the quicksort and mergesort algorithms

Write a program that correctly implements both the Quicksort and Mergesort algorithms. The program should generate an array of 500 random numbers in the 1-100 range. The program should sort the same set of numbers and keep time stamps of how long it ..

  Implement the link list using java programming concepts

Modify the class LinkedList by adding to it the following methods. The appropriate error message should be generated if an invalid condition occurs.

  Creat a class that saves the grades

Creat a class that saves the grades of students in an array, and contains a few methods that do some statistics on these grades. Your task is to create this class, and create client testing class that does all the necessary tests of its methods.

  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.

  Need usual internal node structure and constructor

Create a basic, generic DataTree class. As described, it will consist of a binary tree structure, and will need the usual internal node structure and constructor -  Write the other methods used in Section One of the commented-out test code in Main..

  Make an explicit statement of the invariant of the set class

Write a new container class called ser, which is similar to a bag, except that a set can contain only one copy of any given item, You will need to change the interface a bit. For example, instead of the bag's count function, you'll want a constant..

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