Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
image text in transcribedC#
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

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

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

3rd Edition

978-1119907466

More Books

Students also viewed these Databases questions

Question

7. It is advisable to do favors for people whenever possible.

Answered: 1 week ago

Question

9. Power and politics can be destructive forces in organizations.

Answered: 1 week ago