For Kerry Sales Solutions create a base class named Commission. The class should
ID: 3540683 • Letter: F
Question
For Kerry Sales Solutions create a base class named Commission. The class should contain two public propoerties, a string named SalesId and a double property calledSales. Include a default constructor and a parametorized constructor in the class. Include a GetCommission method(function) that calculates a salesperson's commission using the following formula: sales * .05. then create a derived class named bonusCommission. The derived class's GetCommission method should calculate the commission as follows: sales*.05+(sales-2500)*.01. be sure to include a default constructor and a parameterized constructor in the dervied class.
Explanation / Answer
Hi ,
Please use the following code. It works on my system . Hope it Helps you :)
public class Commission
{
public string SalesId;
public double Sales;
public Commission()
{
// This is an empty default constructor
}
public Commission(string SalesId, double Sales)
{
this.SalesId = SalesId;
this.Sales = Sales;
}
public double GetCommission()
{
return Sales*0.05;
}
}
public class bonusCommission : Commission
{
public bonusCommission()
{
// This is another empty default constructor
}
public bonusCommission(string SalesId, double Sales)
{
this.SalesId = SalesId;
this.Sales = Sales;
}
public double GetCommission()
{
return Sales * 0.05 + (Sales-2500)*0.1;
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.