Advertisement
VodVas

CleanCode_ExampleTask17.cs

Dec 18th, 2024
23
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.44 KB | Cybersecurity | 0 0
  1. public static void CreateObject()
  2. {
  3. }
  4.  
  5. public static void GenerateRandomNumber()
  6. {
  7.     _number = Random.Range(0, 100);
  8. }
  9.  
  10. public static int GetSalary(this int hoursWorked)
  11. {
  12.     if (hoursWorked < 0)
  13.     {
  14.         throw new ArgumentOutOfRangeException("Количество отработанных часов не может быть отрицательным.", nameof(hoursWorked));
  15.     }
  16.  
  17.     return _hourlyRate * hoursWorked;
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement