Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Figure 11.4
- using System;
- namespace Assignment5Part2
- {
- class Assignment5Part2
- {
- static void Main(string[] args) { }
- private decimal baseSalary; // base salary per week
- public class BasePlusCommissionEmployee : CommissionEmployee
- { }
- // six-parameter derived-class constructor
- // with call to base class CommissionEmployee constructor
- public BasePlusCommissionEmployee(string first, string last,
- string ssn, decimal sales, decimal rate, decimal salary)
- {
- BaseSalary = salary; // validate base salary via property
- } // end six-parameter BasePlusCommissionEmployee constructor
- // property that gets and sets
- // BasePlusCommissionEmployee's base salary
- public decimal BaseSalary
- {
- get
- {
- return baseSalary;
- } // end get
- set
- {
- if ( value >= 0 )
- baseSalary = value;
- else
- throw new ArgumentOutOfRangeException( "BaseSalary",
- value, "BaseSalary must be >= 0" );
- } // end set
- } // end property BaseSalary
- // return string representation of BasePlusCommissionEmployee
- public override string ToString()
- {
- } // end method ToString
- } // end class BasePlusCommissionEmployee
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement