Advertisement
Maxkor

Untitled

Jan 22nd, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.32 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 _03.Vacation
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int peapleCount = int.Parse(Console.ReadLine());
  14.             string typeOfCard = Console.ReadLine().ToLower();
  15.             string dayOfWeak = Console.ReadLine().ToLower();
  16.             double totalPrise = 1.00;
  17.  
  18.             if (typeOfCard == "students")
  19.             {
  20.                 if (dayOfWeak == "friday")
  21.                 {
  22.                     totalPrise = peapleCount * 8.54;
  23.                 }
  24.                 else if (dayOfWeak == "saturday")
  25.                 {
  26.                     totalPrise = peapleCount * 9.80;
  27.                 }
  28.                 else
  29.                 {
  30.                     totalPrise = peapleCount * 10.46;
  31.                 }
  32.                 if (peapleCount >= 30)
  33.                 {
  34.                     totalPrise = totalPrise - (totalPrise * 0.15);
  35.                 }
  36.             }
  37.             else if (typeOfCard == "business")
  38.             {
  39.                 if (dayOfWeak == "friday")
  40.                 {
  41.                     totalPrise = peapleCount * 10.90;
  42.                 }
  43.                 else if (dayOfWeak == "saturday")
  44.                 {
  45.                     totalPrise = peapleCount * 15.60;
  46.                 }
  47.                 else
  48.                 {
  49.                     totalPrise = peapleCount * 16;
  50.                 }
  51.                 if (peapleCount >= 100)
  52.                 {
  53.                     totalPrise = totalPrise - (totalPrise / 10);
  54.                 }
  55.             }
  56.             else
  57.             {
  58.                 if (dayOfWeak == "friday")
  59.                 {
  60.                     totalPrise = peapleCount * 15;
  61.                 }
  62.                 else if (dayOfWeak == "saturday")
  63.                 {
  64.                     totalPrise = peapleCount * 20;
  65.                 }
  66.                 else
  67.                 {
  68.                     totalPrise = peapleCount * 22.50;
  69.                 }
  70.                 if (peapleCount <= 20 && peapleCount >= 20)
  71.                 {
  72.                     totalPrise = totalPrise - (totalPrise * 0.05);
  73.                 }
  74.             }
  75.  
  76.  
  77.             Console.WriteLine($"Total price: {totalPrise:f2}");
  78.         }
  79.     }
  80. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement