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: 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: The second subclass is Executive. It has an additional instance variable that reflects the current stock price. It should have the same two methods: 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.

Introduction
The programming project at hand requires writing a program to compute the average salary for a collection of employees of different types. This program involves the implementation of four classes, each with specific functionalities. The main goal of the program is to initialize a mixture of different types of employees, compute their average salary, and display the result. In order to achieve this, careful consideration must be given to good programming style, including private instance variables, named constants, and comprehensive testing.

Employee Class
The first class, called Employee, serves as the base class for all other types of employees. It contains two instance variables: the employee’s name and their monthly salary, which is specified in whole dollars. This class should also have two methods. These methods can be used to retrieve the employee’s name and salary, respectively.

Salesman Class
The second class, Salesman, is a subclass of Employee. In addition to the instance variables inherited from the Employee class, the Salesman class has an additional instance variable that stores the annual sales in whole dollars for that salesman. Like the Employee class, the Salesman class should have the same two methods to retrieve the employee’s name and salary.

Executive Class
The third class, Executive, is another subclass of Employee. It also inherits the instance variables from the base Employee class but has an additional instance variable that represents the current stock price. Similarly to the Employee and Salesman classes, the Executive class should have the same two methods to retrieve the employee’s name and salary.

Main Class
The fourth and final class is responsible for containing the main method. It should create an array of objects of type Employee and initialize them with a mixture of different kinds of employees. This step ensures comprehensive testing of the program. After initializing the array, the main method calculates the average salary for all employees and displays the result.

Good Programming Style
To adhere to good programming style, it is crucial to make all instance variables private. This encapsulation ensures that other parts of the program cannot directly access and modify the variables. Additionally, constants used in the program should be assigned proper names for clarity and maintainability. Following these principles of good programming style enhances code readability, maintainability, and extensibility.

Comprehensive Testing
In order to ensure the program is functioning correctly, it is essential to select enough different kinds of employees to thoroughly test the program. By creating a variety of employee types and carefully setting their attributes, we can cover a wide range of scenarios and validate the accuracy of the average salary calculation.

Conclusion
In conclusion, the first programming project involves implementing a program to compute the average salary for a collection of employees. This requires the creation of four classes: Employee, Salesman, Executive, and Main. By following good programming style and conducting comprehensive testing, we can ensure the program functions correctly and provides accurate results.

Need your ASSIGNMENT done? Use our paper writing service to score better and meet your deadline.


Click Here to Make an Order Click Here to Hire a Writer