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

  Algorithm analysis with advanced data

algorithm analysis with advanced data structuresalchemy-mines of oreland yield unlimited amounts of silver but no gold.

  Assignment on java programming

The listing of Tree.java is supplied below as a starting point for this lab. A picture of Tree.java output is also shown. Either cut/paste the code or type it in. Run the program to verify that it works. Study the listing until you understand comp..

  The goal is to create a project that would let a user

the goal is to create a project that would let a user compute area and perimeter of a polygon. restrict the type of

  Java program that implements an algorithm known as a bubble

writing a simple Java program that implements an algorithm known as a Bubble Sort. A Bubble Sort is a simple sorting algorithm that takes an unsorted array of elements and sorts them into ascending order.

  Developing a java application

You have been requested to develop a Java application for the local library as part of an upgrade initiative. As in all libraries, this is a place where one can check out books

  Project is for designing and developing a college

project is for designing and developing a college registration program. write a java program to register students for a

  In this project you will simulate some people catching fish

in this project you will simulate some people catching fish in a lake. the purpose of the assignment is to get used to

  Robot preparing for competition

Create an event so that the skateboard can be controlled by game player

  Design java program to enter name in input dialog box

Design the program called MailingLabel.java Program must ask user to enter name and address in input dialog box with each component of address seperated by comma.

  Short java paper

Using the simplified OOD methodology:

  Insert in order functionality to your statistics program

You are to add mean, standard deviation, and insert in order functionality to your statistics list program.

  Implement program that uses priority queues of strings

Write a program in Java that uses priority queues of strings to sort lines of text in reverse alphabetic order. You may choose how you define alphabetic order.

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