Advertisement
Guest User

emp class

a guest
Oct 19th, 2018
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.88 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4.  
  5. namespace DefiningClasses
  6. {
  7.     class Employee
  8.     {
  9.         private string name;
  10.         private decimal salary;
  11.         private string position;
  12.         private string department;
  13.         private string email;
  14.         private int age;
  15.  
  16.         public Employee(string name, decimal salary, string position, string department)
  17.         {
  18.             Name = name;
  19.             Salary = salary;
  20.             Position = position;
  21.             Department = department;
  22.             Email = "n/a";
  23.             Age = -1;
  24.         }
  25.  
  26.         public string Name { get; set; }
  27.  
  28.         public decimal Salary { get; set; }
  29.  
  30.         public string Position { get; set; }
  31.  
  32.         public string Department { get; set; }
  33.  
  34.         public string Email { get; set; }
  35.  
  36.         public int Age { get; set; }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement