Advertisement
Guest User

Easter Trip

a guest
Feb 29th, 2020
737
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.09 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _3
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string country = Console.ReadLine();
  10.             string dates = Console.ReadLine();
  11.             int nights = int.Parse(Console.ReadLine());
  12.  
  13.             double sum = 0;
  14.             double nightPrice = 0;
  15.  
  16.             if (country == "France")
  17.             {
  18.                 if (dates == "21-23")
  19.                 {
  20.                     nightPrice = 30;
  21.                     sum = nightPrice * nights;
  22.                 }
  23.                 else if (dates == "24-27")
  24.                 {
  25.                     nightPrice = 35;
  26.                     sum = nightPrice * nights;
  27.                 }
  28.                 else if (dates == "28-31")
  29.                 {
  30.                     nightPrice = 40;
  31.                     sum = nightPrice * nights;
  32.                 }
  33.             }
  34.             else if (country == "Italy")
  35.             {
  36.                 if (dates == "21-23")
  37.                 {
  38.                     nightPrice = 28;
  39.                     sum = nightPrice * nights;
  40.                 }
  41.                 else if (dates == "24-27")
  42.                 {
  43.                     nightPrice = 32;
  44.                     sum = nightPrice * nights;
  45.                 }
  46.                 else if (dates == "28-31")
  47.                 {
  48.                     nightPrice = 39;
  49.                     sum = nightPrice * nights;
  50.                 }
  51.             }
  52.             else if (country == "Germany")
  53.             {
  54.                 if (dates == "21-23")
  55.                 {
  56.                     nightPrice = 32;
  57.                     sum = nightPrice * nights;
  58.                 }
  59.                 else if (dates == "24-27")
  60.                 {
  61.                     nightPrice = 37;
  62.                     sum = nightPrice * nights;
  63.                 }
  64.                 else if (dates == "28-31")
  65.                 {
  66.                     nightPrice = 43;
  67.                     sum = nightPrice * nights;
  68.                 }
  69.             }
  70.             Console.WriteLine($"Easter trip to {country} : {sum:f2} leva.");
  71.         }
  72.     }
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement