Advertisement
Guest User

Untitled

a guest
Feb 24th, 2020
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.30 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Shop2
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             //            Магазин за плодове през работните дни работи на следните цени:
  10.             //            плод banana  apple orange  grapefruit kiwi    pineapple grapes
  11.             //           цена  2.50    1.20  0.85    1.45       2.70    5.50      3.85
  12.             //Събота и неделя магазинът работи на по - високи цени:
  13.             //            плод banana  apple orange  grapefruit kiwi    pineapple grapes
  14.             //цена             2.70    1.25    0.90    1.60    3.00    5.60    4.20
  15.             string fruits = Console.ReadLine();
  16.             string day = Console.ReadLine();
  17.             double kolichestvo = double.Parse(Console.ReadLine());
  18.  
  19.             if (day == "Monday" || day == "Tuesday" || day == "Wednesday" || day == "Thursday" || day == "Friday")
  20.             {
  21.                 if (fruits == "banana")
  22.                 {
  23.                     Console.WriteLine($"{kolichestvo * 2.50:F2}");
  24.                 }
  25.                 else if (fruits == "apple")
  26.                 {
  27.                     Console.WriteLine($"{kolichestvo * 1.20:F2}");
  28.                 }
  29.                 else if (fruits == "orange")
  30.                 {
  31.                     Console.WriteLine($"{kolichestvo * 0.85:F2}");
  32.                 }
  33.                 else if (fruits == "grapefruit")
  34.                 {
  35.                     Console.WriteLine($"{kolichestvo * 1.45:F2}");
  36.                 }
  37.                 else if (fruits == "kiwi")
  38.                 {
  39.                     Console.WriteLine($"{kolichestvo * 2.70:F2}");
  40.                 }
  41.                 else if (fruits == "pineapple")
  42.                 {
  43.                     Console.WriteLine($"{kolichestvo * 5.50:F2}");
  44.                 }
  45.                 else if (fruits == "grapes")
  46.                 {
  47.                     Console.WriteLine($"{kolichestvo * 3.85:F2}");
  48.                 }
  49.             }
  50.             else if (day == "Saturday" || day == "Sunday")
  51.             {
  52.                 if (fruits == "banana")
  53.                 {
  54.                     Console.WriteLine($"{kolichestvo * 2.70:F2}");
  55.                 }
  56.                 else if (fruits == "apple")
  57.                 {
  58.                     Console.WriteLine($"{kolichestvo * 1.25:F2}");
  59.                 }
  60.                 else if (fruits == "orange")
  61.                 {
  62.                     Console.WriteLine($"{kolichestvo * 0.90:F2}");
  63.                 }
  64.                 else if (fruits == "grapefruit")
  65.                 {
  66.                     Console.WriteLine($"{kolichestvo * 1.60:F2}");
  67.                 }
  68.                 else if (fruits == "kiwi")
  69.                 {
  70.                     Console.WriteLine($"{kolichestvo * 3.00:F2}");
  71.                 }
  72.                 else if (fruits == "pineapple")
  73.                 {
  74.                     Console.WriteLine($"{kolichestvo * 5.60:F2}");
  75.                 }
  76.                 else if (fruits == "grapes")
  77.                 {
  78.                     Console.WriteLine($"{kolichestvo * 4.20:F2}");
  79.                 }
  80.             }
  81.             else
  82.             {
  83.                 Console.WriteLine("Error");
  84.             }
  85.         }
  86.     }
  87. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement