Advertisement
MladenKarachanov

не е решена Fruit shop

Feb 19th, 2025
111
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.83 KB | None | 0 0
  1. string day = Console.ReadLine();
  2. string frut = Console.ReadLine();
  3. double quantity = double.Parse(Console.ReadLine());
  4.  
  5. double price = 0;
  6. if (day == "Monday" || day == "Tuesday" || day == "Wednesday" || day == "Thursday" || day == "Friday")
  7.  
  8.     if (frut == "banana")
  9.     {
  10.         price = quantity * 2.50;
  11.     }
  12.     else if (frut == "apple")
  13.     {
  14.         price = quantity * 1.20;
  15.     }
  16.     else if (frut == "orange")
  17.     {
  18.         price = quantity * 0.85;
  19.     }
  20.     else if (frut == "grapefruit")
  21.     {
  22.         price = quantity * 1.45;
  23.     }
  24.     else if (frut == "kiwi")
  25.     {
  26.         price = quantity * 2.70;
  27.     }
  28.     else if (frut == "pineapple")
  29.     {
  30.         price = quantity * 5.50;
  31.     }
  32.     else if (frut == "grapes")
  33.     {
  34.         price = quantity * 3.85;
  35.     }
  36.  
  37.  
  38. Console.WriteLine(price);
  39.  
  40.  
  41.  
  42.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement