Valantina

LuggageTax/Ex/27.07.2019

Jul 29th, 2019
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.29 KB | None | 0 0
  1. using System;
  2.  
  3. namespace P03_LuggageTax
  4. {
  5.     class P03_LuggageTax
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int width = int.Parse(Console.ReadLine());
  10.             int height = int.Parse(Console.ReadLine());
  11.             int length = int.Parse(Console.ReadLine());
  12.             string hasPriorityTicket = Console.ReadLine();
  13.  
  14.             int volume = width * height * length;
  15.             double price = 0;
  16.  
  17.             if (volume >= 50 && volume <= 100)
  18.             {
  19.                 if ("false" == hasPriorityTicket)
  20.                 {
  21.                     price = 25;
  22.                 }
  23.             }
  24.             else if (volume > 100 && volume <= 200)
  25.             {
  26.                 if ("true" == hasPriorityTicket)
  27.                 {
  28.                     price = 10;
  29.                 }
  30.                 else
  31.                 {
  32.                     price = 50;
  33.                 }
  34.             }
  35.             else if (volume > 200 && volume <= 300)
  36.             {
  37.                 if ("true" == hasPriorityTicket)
  38.                 {
  39.                     price = 20;
  40.                 }
  41.                 else
  42.                 {
  43.                     price = 100;
  44.                 }
  45.             }
  46.  
  47.             Console.WriteLine($"Luggage tax: {price:F2}");
  48.         }
  49.     }
  50. }
Advertisement
Add Comment
Please, Sign In to add comment