Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Employee {
- public string firstName {get; set;} //getters and setters for the values
- public string lastName{get, set};
- private decimal yearlySalary;
- public Employee(string firstName, string lastName, decimal monthlySalary) //constructor
- {
- FirstName = firstName;
- LastName = lastName;
- Salary = yearlySalary;
- }
- public decimal yearlySalary{
- get {return yearlySalary;}
- set{
- if(value>=0)
- yearlySalary = value;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement