Advertisement
Dianov

Conditional Statements Advanced - Exercise (09. Volleyball (not included in final score))

Nov 14th, 2020 (edited)
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.96 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 Volleyball
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string year = Console.ReadLine();
  14.             double p = double.Parse(Console.ReadLine());
  15.             double h = double.Parse(Console.ReadLine());
  16.  
  17.             double gamesInSofia = (48 - h) * 0.75;
  18.             double holidayGames = p * (2.0 / 3.0);
  19.             double allGames = gamesInSofia + holidayGames + h;
  20.  
  21.             if (year == "leap")
  22.             {
  23.                 double additionalGames = allGames * (15.0 / 100.0);
  24.                 double sum = allGames + additionalGames;
  25.                 Console.WriteLine(Math.Floor(sum));
  26.             }
  27.             else if (year == "normal")
  28.             {
  29.                 Console.WriteLine(Math.Floor(allGames));
  30.             }
  31.             Console.ReadLine();
  32.         }
  33.     }
  34. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement