Advertisement
Chessmaster

Untitled

Sep 22nd, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.51 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Globalization;
  5. using System.Numerics;
  6.  
  7. namespace Practice
  8. {
  9.     class Program
  10.     {
  11.  
  12.         static void Main()
  13.         {
  14.             int peopleCount = int.Parse(Console.ReadLine());
  15.             string peopleType = Console.ReadLine();
  16.             string dayType = Console.ReadLine();
  17.  
  18.             double students = 0;
  19.             double business = 0;
  20.             double regular = 0;
  21.  
  22.             if (dayType == "Monday")
  23.             {
  24.                 students = 9.5;
  25.                 business = 11.80;
  26.                 regular = 15;
  27.             }
  28.             else if (dayType == "Tuesday")
  29.             {
  30.                 students = 8;
  31.                 business = 14.50;
  32.                 regular = 15;
  33.             }
  34.             else if (dayType == "Wednesday")
  35.             {
  36.                 students = 6.85;
  37.                 business = 12.60;
  38.                 regular = 14.80;
  39.             }
  40.             else if (dayType == "Thursday")
  41.             {
  42.                 students = 7.15;
  43.                 business = 13.20;
  44.                 regular = 13.90;
  45.             }
  46.             else if (dayType == "Friday")
  47.             {
  48.                 students = 8.45;
  49.                 business = 10.90;
  50.                 regular = 15;
  51.             }
  52.             else if (dayType == "Saturday")
  53.             {
  54.                 students = 9.80;
  55.                 business = 15.60;
  56.                 regular = 20;
  57.             }
  58.             else if (dayType == "Sunday")
  59.             {
  60.                 students = 10.46;
  61.                 business = 16;
  62.                 regular = 22.50;
  63.             }
  64.  
  65.             if (peopleCount >= 30)
  66.             {
  67.                 students *= 0.85;
  68.             }
  69.  
  70.             if (peopleCount >= 100)
  71.             {
  72.                 peopleCount -= 10;
  73.             }
  74.  
  75.             if (peopleCount >= 10 && peopleCount <= 20)
  76.             {
  77.                 regular *= 0.95;
  78.             }
  79.  
  80.             students *= peopleCount;
  81.             business *= peopleCount;
  82.             regular *= peopleCount;
  83.  
  84.             if (peopleType == "Students")
  85.             {
  86.                 Console.WriteLine("Total price: {0:f2}", students);
  87.             }
  88.             else if (peopleType == "Business")
  89.             {
  90.                 Console.WriteLine("Total price: {0:f2}", business);
  91.             }
  92.             else
  93.             {
  94.                 Console.WriteLine("Total price: {0:f2}", regular);
  95.             }
  96.         }
  97.     }
  98. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement