Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Practice
- {
- class Program
- {
- static void Main(string[] args)
- {
- int hourOfBeginning = int.Parse(Console.ReadLine());
- int hourOfChecking = int.Parse(Console.ReadLine());
- int minOfChecking = int.Parse(Console.ReadLine());
- string dayOfWeek = Console.ReadLine();
- double bonusPoints = 0;
- switch (dayOfWeek)
- {
- case "Monday":
- bonusPoints = 0.6;
- break;
- case "Wednesday":
- bonusPoints = 0.6;
- break;
- case "Friday":
- bonusPoints = 0.6;
- break;
- case "Tuesday":
- bonusPoints = 0.8;
- break;
- case "Thursday":
- bonusPoints = 0.8;
- break;
- case "Saturday":
- bonusPoints = 0.8;
- break;
- case "Sunday":
- bonusPoints = 2;
- break;
- default:
- break;
- }
- if (hourOfChecking < hourOfBeginning && hourOfChecking <= (hourOfBeginning - 1))
- {
- bonusPoints += 1.5;
- }
- else if (hourOfChecking == hourOfBeginning && minOfChecking <= 30)
- {
- bonusPoints += 1;
- }
- else if((hourOfChecking == hourOfBeginning && minOfChecking > 30) || hourOfChecking < (hourOfBeginning + 4))
- {
- bonusPoints += 0.5;
- }
- Console.WriteLine($"{bonusPoints:F2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement