Advertisement
Guest User

Untitled

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