Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Instructions Steps Copy code from Lab 6 OOP into main.cs and employee.cs Update the Employee in Employee.cs PROPERTIES Create properties as shown below: ( Hint:
Instructions
Steps
Copy code from Lab OOP into main.cs and employee.cs
Update the Employee in Employee.cs
PROPERTIES
Create properties as shown below: Hint: in Cat.csName is property. name is member variable
FirstName Validation: None Auto implemented property
LastName Validation: None Auto implemented property
Age Validation: Cannot be less than If so set as
YearlySalary Validation: Cannot be less than $ If so set it to $
Id Validation: None Auto implemented property
EmploymentStatus Validation: None Auto implemented property
Everywhere inside your Employee.cs instead of using member variables use the properties Example: replace firstname with FirstName
METHODS
Create the following methods
IncreaseSalary
This method will accept the "percent" as input parameter and calculate the total salary after increase. If the input parameter is valid, a success message is written to console. Else a failure message is displayed.
For example, if the salary is and the IncreaseSalary method is called with increase as the input parameter, then the total salary will be This method will set "YearlySalary" property to
Example: if input is and yearly salary is then the method will display:
Yearly salary updated to
if IncreaseSalary method is called with a negative "percent" parameter, the method will not update YearlySalary and display "Invalid input. Yearly Salary not updated".
Invalid input. Yearly Salary not updated.
RemoveEmployee
This method will not have any input parameter. This method will: first check if employmentstatus is "inactive" if so write to console "Employee already inactive" if employmentstatus is "active" then change it to "inactive". Write to console Employee removed
TESTING YOUR CLASS
You should test all these conditions and include screenshots. Test with at least sets of employees.
Create employee by calling the Constructor with no parameters.
Call Intro method for employee
Output should look like this.
Hello! My name is Unknown unknown
Here are some details about me:
Age:
Id:
Employment Status:active
Create employee by calling the Constructor with parameters.
FirstNameJohn
LastNameSmith
Id
Age
YearlySalary
Call IncreaseSalary method with as input
Output should look like this:
Invalid input. Yearly Salary not updated.
Call RemoveEmployee. Output should look like this:
Employee removed
Call Intro method.
Hello! My name is John Smith
Here are some details about me:
Age:
Id:
Employment Status:inactive
Create employee by calling the Constructor with parameters.
FirstNameRobert
LastNameDowney
Id
Age
For this employee:
Call Intro method
Set Yearly Salary of this employee to
Call Intro method for the employee
Output should look like this:
Hello! My name is Robert Downey
Here are some details about me:
Age:
Id:
Employment Status:active
Create employee by calling the Constructor with parameters.
For employee : Call IncreaseSalary method with as input
Call RemoveEmployee.
Call RemoveEmployee. Calling for the nd time on purpose
Call Intro method
Output should look like this:
Yearly Salary after increase $
Employee removed successfully!
Employee already inactive!
Hello! My name is Maria Lambert
Here are some details about me:
Age:
Id:
Employment Status:inactive
Run the test now. Im really confused what goes in the main.cs and tthe employee.cs I already had the "paste Lab OOP" portion of the question.
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