Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CLASS: Intro to Programming Using C# Week 10 Challenge Assignment (Worth 25 extra points for the week if successfully completed) In addition to your regular

CLASS: Intro to Programming Using C#

Week 10 Challenge Assignment (Worth 25 extra points for the week if successfully completed)

In addition to your regular assignment you may attempt to complete the following challenge assignment for extra credit. If you do not attempt the assignment or hand it in your grade for the week will not be affected. If you complete the assignment, meet all of the requirements listed, and the program compiles and runs then you will receive 25 extra credit points for the week. The challenge is only valid for points during the week in which it is available.

This is not a substitute for your regular assignment and you will only receive the extra credit if you have also submitted your regular assignment.

I would also encourage you to try the challenge as practice even if you do not choose to submit it.

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.

Submit this challenge to the link provided below.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Systems An Application Oriented Approach Complete Version

Authors: Michael Kifer, Arthur Bernstein, Richard Lewis

2nd Edition

0321268458, 978-0321268457

More Books

Students also viewed these Databases questions

Question

1. What is diversity?

Answered: 1 week ago

Question

l Develop an organization chart using job families.

Answered: 1 week ago

Question

What is the basis for Security Concerns in Cloud Computing?

Answered: 1 week ago

Question

Describe the three main Cloud Computing Environments.

Answered: 1 week ago