Advertisement
Guest User

Untitled

a guest
Jan 20th, 2017
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. using System;
  2. class Employee {
  3. public string firstName {get; set;} //getters and setters for the values
  4. public string lastName{get, set};
  5. private decimal yearlySalary;
  6.  
  7. public Employee(string firstName, string lastName, decimal monthlySalary) //constructor
  8. {
  9. FirstName = firstName;
  10. LastName = lastName;
  11. Salary = yearlySalary;
  12. }
  13. public decimal yearlySalary{
  14. get {return yearlySalary;}
  15. set{
  16. if(value>=0)
  17. yearlySalary = value;
  18. }
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement