aggressiveviking

Untitled

Feb 25th, 2020
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.93 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _03.MovieDestination
  4. {
  5.     class MovieDestination
  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 numDays = int.Parse(Console.ReadLine());
  13.  
  14.             double price = 0.0;
  15.             double totalPrice = 0.0;
  16.  
  17.             if (destination == "Dubai")
  18.             {
  19.                 if (season == "Winter")
  20.                 {
  21.                     price = numDays * 45000;
  22.                     totalPrice = price - (price * 0.3);
  23.                 }
  24.                 else
  25.                 {
  26.                     price = numDays * 40000;
  27.                     totalPrice = price - (price * 0.3);
  28.                 }
  29.             }
  30.             else if (destination == "Sofia")
  31.             {
  32.                 if (season == "Winter")
  33.                 {
  34.                     price = numDays * 17000;
  35.                     totalPrice = price + (price * 0.25);
  36.                 }
  37.                 else
  38.                 {
  39.                     price = numDays * 12500;
  40.                     totalPrice = price + (price * 0.25);
  41.                 }
  42.             }
  43.             else if (destination == "London")
  44.             {
  45.                 if (season == "Winter")
  46.                 {
  47.                     totalPrice = numDays * 24000;
  48.                 }
  49.                 else
  50.                 {
  51.                     totalPrice = numDays * 20250;
  52.                 }        
  53.             }
  54.  
  55.             if (totalPrice <= budget)
  56.             {
  57.                 Console.WriteLine($"The budget for the movie is enough! We have {Math.Abs(budget - totalPrice):f2} leva left!");
  58.             }
  59.             else
  60.             {
  61.                 Console.WriteLine($"The director needs {Math.Abs(budget - totalPrice):f2} leva more!");
  62.             }
  63.         }
  64.     }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment