silvana1303

Movie Destination

Apr 30th, 2020
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.71 KB | None | 0 0
  1. using System;
  2.  
  3. namespace exampreparation
  4. {
  5.     class exam
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double budget = double.Parse(Console.ReadLine());
  10.             string destination = Console.ReadLine();
  11.             string season = Console.ReadLine();
  12.             int days = int.Parse(Console.ReadLine());
  13.  
  14.             int price = 0;
  15.  
  16.  
  17.             if (season == "Winter")
  18.             {
  19.                 if (destination == "Dubai")
  20.                 {
  21.                     price = 45000;
  22.                 }
  23.                 else if (destination == "Sofia")
  24.                 {
  25.                     price = 17000;
  26.                 }
  27.                 else
  28.                 {
  29.                     price = 24000;
  30.                 }
  31.             }
  32.             else
  33.             {
  34.                 if (destination == "Dubai")
  35.                 {
  36.                     price = 40000;
  37.                 }
  38.                 else if (destination == "Sofia")
  39.                 {
  40.                     price = 12500;
  41.                 }
  42.                 else
  43.                 {
  44.                     price = 20250;
  45.                 }
  46.             }
  47.  
  48.             double sum = price * days;
  49.  
  50.             if (destination == "Dubai")
  51.             {
  52.                 sum *= 0.70;
  53.             }
  54.             if (destination == "Sofia")
  55.             {
  56.                 sum *= 1.25;
  57.             }
  58.  
  59.             if (budget >= sum)
  60.             {
  61.                 Console.WriteLine($"The budget for the movie is enough! We have {budget-sum:f2} leva left!");
  62.             }
  63.             else
  64.             {
  65.                 Console.WriteLine($"The director needs {sum-budget:f2} leva more!");
  66.             }
  67.         }
  68.     }
  69. }
Add Comment
Please, Sign In to add comment