Sybatron

Vacation Tech4.0

Jan 27th, 2019
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.68 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Vacation
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int count = int.Parse(Console.ReadLine());
  10.             string type = Console.ReadLine();
  11.             string day = Console.ReadLine();
  12.             double price = 0;
  13.             if (type == "Students")
  14.             {
  15.                 switch (day)
  16.                 {
  17.                     case "Friday":
  18.                         {
  19.                             price = 8.45;
  20.                             break;
  21.                         }
  22.                     case "Saturday":
  23.                         {
  24.                             price = 9.80;
  25.                             break;
  26.                         }
  27.                     case "Sunday":
  28.                         {
  29.                             price = 10.46;
  30.                             break;
  31.                         }
  32.                 }
  33.                 price *= count;
  34.                 if (count >= 30)
  35.                 {
  36.                     price *= 0.85;
  37.                 }
  38.             }
  39.             if (type == "Business")
  40.             {
  41.                 switch (day)
  42.                 {
  43.                     case "Friday":
  44.                         {
  45.                             price = 10.90;
  46.                             break;
  47.                         }
  48.                     case "Saturday":
  49.                         {
  50.                             price = 15.60;
  51.                             break;
  52.                         }
  53.                     case "Sunday":
  54.                         {
  55.                             price = 16;
  56.                             break;
  57.                         }
  58.                 }
  59.                 if (count >= 100)
  60.                 {
  61.                     count -= 10;
  62.                 }
  63.                 price *= count;
  64.             }
  65.             if (type == "Regular")
  66.             {
  67.                 switch (day)
  68.                 {
  69.                     case "Friday":
  70.                         {
  71.                             price = 15;
  72.                             break;
  73.                         }
  74.                     case "Saturday":
  75.                         {
  76.                             price = 20;
  77.                             break;
  78.                         }
  79.                     case "Sunday":
  80.                         {
  81.                             price = 22.50;
  82.                             break;
  83.                         }
  84.                 }
  85.                 price *= count;
  86.                 if (count >= 10 && count <= 20)
  87.                 {
  88.                     price *= 0.95;
  89.                 }
  90.             }
  91.  
  92.             Console.WriteLine($"Total price: {price:f2}");
  93.         }
  94.     }
  95. }
Advertisement
Add Comment
Please, Sign In to add comment