Question
You will write a console program that will meet the following requirements: Create a console program where you will implement coding constructs classes and variables
You will write a console program that will meet the following requirements:
Create a console program where you will implement coding constructs classes and variables that are needed for this program.
Create an employee class.
Declare all class variables as private. Declare class variables for salary, a string paygrade, and a constant double variable for base salary, string variables for employee last name, employee first name and an integer variable for employee job level.
Create and implement properties (accessors) to get/set the values for employee last name, employee first name and employee level class variables. These should NOT be automatic properties; they will be used wherever these three class variables are referenced in the class.
Create an employee class constructor that will receive the string last name, string first name and integer level when the class object is instantiated and use the accessors to assign the passed values.
Create a public class method to calculate the salary, a public class method to set the paygrade and a public class method to display the output (as shown in the output example).
The set paygrade class method will check the employee level and assign the string value of "Entry Level" if the level passed in is 1, "Mid-Level" if the level passed in is 2 and "Senior Level" if the level passed in is 3.
The calculate salary class method will compute salary based on the following:
If the level is 1 and paygrade is entry level then salary is the base salary times 1.
If the level is 2 and paygrade is mid level then salary is the base salary times 3.
If the level is 3 and paygrade is senior level then salary is the base salary times 5.
The public display class method will display the information as shown in the output example shown below.
In Main you will:
Instantiate three (3) employee object passing the following to the constructor
last name, first name and level number 1, 2 or 3 for each object respectively.
For each instantiated object you will call the set paygrade, calculate salary and display employee class methods following instantiation of each object.
You should format your output to look like the following:
Employee Jack Spratt is a Entry Level with a salary of $35,000.00 Employee Jane Doe is a Mid-Level with a salary of $105,000.00 Employee John Smith is a Senior Level with a salary of $175,000.00 Press any key to continue . . .
This will require some analysis of the problem before coding is accomplished.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started