Question: C# 1. Consider the following code for an Employee class and answer the questions that follow accordingly: class Employee { private double monthlySalary; public int

 C# 1. Consider the following code for an Employee class and
answer the questions that follow accordingly: class Employee { private double monthlySalary;C#

1. Consider the following code for an Employee class and answer the questions that follow accordingly: class Employee { private double monthlySalary; public int IdNum { get; set; } public string Name { get; set; } public double Monthlysalary { get; set; } public Employee(int id, string name, double salary) { id; Name - name; MonthlySalary - salary: } IdNum - public virtual double PayCheck (Employee employee) { MonthlySalary - monthlySalary; return monthlysalary; } public void Employee Info(Employee employee) { WriteLine("Employee (O} has an ID number of {1} and receives a monthly salary of {2}", Name, IdNum, MonthlySalary.ToString("C")); } } 1.4 Assume that CommissionEmployee is a child class of Employee. It inherits all the members of its parents and also have an auto-implemented property called CommissionRate and another one called SalesAmount. Ac- cordingly, write a constructor for class CommissionEmployee. 1.5 Assume that the commissioned employee receives a monthly salary plus a commission that can be calculated as follows: Commission = Sales Amount * Commission Rate Commissioned Salary = Monthly Salary + Commission Accordingly, write a method in CommissonEmployee class that overrides the PayCheck method in the parent class to calculate the salary of commissioned employees. 1.6 Write two statements that create two objects, one for each class

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!