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

  Show all the objects that are common to both lists

Prepare the segment of code assuming that the objects are of type String and

  Write a program that reads in a text file and then computes

Write a program that reads in a text file and then computes and prints a table of letter frequencies. For example, if the file is the text of "A Tale of Two Cities", found in the file at data/tales.txt , the program will print

  Design a class named large integers

Design a class named largeIntegers such that an object of this class can store an integer of any number of digits.

  One search function

One search function will use a sentinel to mark the end of the array. The other search function will use an array length (maximum legal index into the array) to determine when to exit the search loop. Both functions must return true when the searc..

  Java program that prompts the user to input an integer

Write a Java program that prompts the user to input an integer and then outputs both the individual digits of the number and the sum of the digits.

  Write a java application that allows the user to read

Write a java application that allows the user to read, validate, store, display, sort and search the account number and balance for N bank customers.

  Use inheritance to read, store, and print questions for test

use inheritance to read, store, and print questions for a test. First, write an abstract class

  Write a program called inheritancetest java

Write a program called InheritanceTest.java to support an inheritance hierarchy for class Point-Square-Cube. Use Point as the superclass of the hierarchy. Specify the instance variables and methods for each class.

  A fault is fundamentally a deviation from expected behavior

write a 200- to 300-word short-answer response to the following a fault is basically a deviation from expected

  Display the value stored at the index

Display the value stored at the index. Take a screenshot to verify that the words in your Array or ArrayList are displayed successfully.

  Compute the average grades

Write a program that allows a teacher to compute the average grades for EACH student in his or her class (NOT a single average for the entire class)

  Provide java code for a method

Provide Java code for a method that would perform functionality of your choice. Try to create functionality that is unique - something that you could use. Be sure to include an example call to your method and explain the code you developed.

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