Advertisement
Guest User

Untitled

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