Advertisement
Sim0o0na

03. Cat Training Attendance

Jun 18th, 2018
588
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.87 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Practice
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int hourOfBeginning = int.Parse(Console.ReadLine());
  14.             int hourOfChecking = int.Parse(Console.ReadLine());
  15.             int minOfChecking = int.Parse(Console.ReadLine());
  16.             string dayOfWeek = Console.ReadLine();
  17.  
  18.             double bonusPoints = 0;
  19.  
  20.             switch (dayOfWeek)
  21.             {
  22.                 case "Monday":
  23.                     bonusPoints = 0.6;
  24.                     break;
  25.                 case "Wednesday":
  26.                     bonusPoints = 0.6;
  27.                     break;
  28.                 case "Friday":
  29.                     bonusPoints = 0.6;
  30.                     break;
  31.                 case "Tuesday":
  32.                     bonusPoints = 0.8;
  33.                     break;
  34.                 case "Thursday":
  35.                     bonusPoints = 0.8;
  36.                     break;
  37.                 case "Saturday":
  38.                     bonusPoints = 0.8;
  39.                     break;
  40.                 case "Sunday":
  41.                     bonusPoints = 2;
  42.                     break;
  43.                 default:
  44.                     break;
  45.             }
  46.  
  47.  
  48.             if (hourOfChecking < hourOfBeginning && hourOfChecking <= (hourOfBeginning - 1))
  49.             {
  50.                 bonusPoints += 1.5;
  51.  
  52.             }
  53.             else if (hourOfChecking == hourOfBeginning && minOfChecking <= 30)
  54.             {
  55.                 bonusPoints += 1;
  56.             }
  57.  
  58.             else if((hourOfChecking == hourOfBeginning && minOfChecking > 30) || hourOfChecking < (hourOfBeginning + 4))
  59.             {
  60.                 bonusPoints += 0.5;
  61.             }
  62.             Console.WriteLine($"{bonusPoints:F2}");
  63.  
  64.         }
  65.     }
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement