mitko2204

Worker

Feb 18th, 2021
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4.  
  5. namespace Mankind11b
  6. {
  7. public class Worker : Human
  8. {
  9. private double weekSalary;
  10. private int workingHours;
  11.  
  12. public double WeekSalary
  13. {
  14. get { return weekSalary; }
  15. set {
  16. if (!(value > 10))
  17. {
  18. throw new ArgumentException("Expected value mismatch! Argument: weekSalary");
  19. }
  20. weekSalary = value;
  21. }
  22. }
  23. public int WirkingHours
  24. {
  25. get { return workingHours; }
  26. set {
  27. if (!(value >= 1 && value <= 12))
  28. {
  29. throw new ArgumentException("Expected value mismatch! Argument: workHoursPerDay");
  30. }
  31. workingHours = value;
  32. }
  33. }
  34.  
  35. }
  36. }
  37.  
Advertisement
Add Comment
Please, Sign In to add comment