Advertisement
silvana1303

safari

May 1st, 2020
525
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.88 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.             double gas = double.Parse(Console.ReadLine());
  11.             string weekend = Console.ReadLine();
  12.  
  13.             double gasSum = gas * 2.10;
  14.             double tourGuide = gasSum + 100;
  15.  
  16.             if (weekend == "Saturday")
  17.             {
  18.                 tourGuide *= 0.90;
  19.             }
  20.             else
  21.             {
  22.                 tourGuide *= 0.80;
  23.             }
  24.  
  25.             if (budget >= tourGuide)
  26.             {
  27.                 Console.WriteLine($"Safari time! Money left: {budget-tourGuide:f2} lv.");
  28.             }
  29.             else
  30.             {
  31.                 Console.WriteLine($"Not enough money! Money needed: {tourGuide-budget:f2} lv.");
  32.             }
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement