Advertisement
VickyFilly

C#Basics_Volleyball

Feb 12th, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.01 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _12_Volleyball
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string typeyear = Console.ReadLine().ToLower();
  10.             double holidays = double.Parse(Console.ReadLine());
  11.             double weekendhome = double.Parse(Console.ReadLine());     // plays at home on sunday (1 day)
  12.  
  13.             double insofiaweekend = 48 - weekendhome;            //weekends in sofia (total) weekends total - weekends home
  14.             double offworkweekends = insofiaweekend * 3 / 4;   // weekends in sofia (no work), plays saturday (1 day)
  15.  
  16.             double holidayplay = holidays * 2 / 3;             //total holidays play
  17.  
  18.             double totaldays = weekendhome + offworkweekends + holidayplay;
  19.  
  20.             switch (typeyear)
  21.             {
  22.                 case "normal": Console.WriteLine(Math.Floor(totaldays)); break;
  23.                 case "leap": Console.WriteLine(Math.Floor(totaldays + (totaldays * 0.15))); break;
  24.             }
  25.  
  26.         }
  27.     }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement