Advertisement
hehasmoxie

Untitled

Oct 11th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. // Figure 11.4
  2.  
  3. using System;
  4.  
  5. namespace Assignment5Part2
  6. {
  7.  
  8. class Assignment5Part2
  9. {
  10.  
  11.  
  12.  
  13. static void Main(string[] args) { }
  14. private decimal baseSalary; // base salary per week
  15. public class BasePlusCommissionEmployee : CommissionEmployee
  16. { }
  17. // six-parameter derived-class constructor
  18. // with call to base class CommissionEmployee constructor
  19. public BasePlusCommissionEmployee(string first, string last,
  20. string ssn, decimal sales, decimal rate, decimal salary)
  21.  
  22. {
  23. BaseSalary = salary; // validate base salary via property
  24. } // end six-parameter BasePlusCommissionEmployee constructor
  25.  
  26. // property that gets and sets
  27. // BasePlusCommissionEmployee's base salary
  28. public decimal BaseSalary
  29. {
  30. get
  31. {
  32. return baseSalary;
  33. } // end get
  34. set
  35. {
  36. if ( value >= 0 )
  37. baseSalary = value;
  38. else
  39. throw new ArgumentOutOfRangeException( "BaseSalary",
  40. value, "BaseSalary must be >= 0" );
  41. } // end set
  42. } // end property BaseSalary
  43.  
  44. // return string representation of BasePlusCommissionEmployee
  45. public override string ToString()
  46. {
  47.  
  48.  
  49. } // end method ToString
  50. } // end class BasePlusCommissionEmployee
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement