Guest User

Untitled

a guest
Dec 17th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.61 KB | None | 0 0
  1. namespace BadCode {
  2.     internal class Employee {
  3.         public readonly int MonthSalary;
  4.  
  5.         public bool IsManager;
  6.  
  7.         protected Employee(int monthSalary) {
  8.             MonthSalary = monthSalary;
  9.         }
  10.     }
  11.  
  12.     internal class SalaryService {
  13.         public void PaySalary(Employee employee) {
  14.             int yearBonus;
  15.             if (employee.IsManager) {
  16.                 yearBonus = employee.MonthSalary*12;
  17.             } else {
  18.                 yearBonus = employee.MonthSalary*2;
  19.             }
  20.             Console.WriteLine("Year bonus is: {0}", yearBonus);
  21.         }
  22.     }
  23. }
Add Comment
Please, Sign In to add comment