Advertisement
Sim0o0na

Untitled

Jun 8th, 2017
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.21 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Fruit_Shop
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var fruit = Console.ReadLine().ToLower();
  14.             var day = Console.ReadLine().ToLower();
  15.             var quantity = Double.Parse(Console.ReadLine());
  16.  
  17.  
  18.             if (day == "saturday" || day == "sunday")
  19.             {
  20.                 var price = 0.0;
  21.                 if (fruit == "banana") price = 2.70;
  22.                 else if (fruit == "apple") price = 1.25;
  23.                 else if (fruit == "orange") price = 0.90;
  24.                 else if (fruit == "grapefruit") price = 1.60;
  25.                 else if (fruit == "kiwi") price = 3.00;
  26.                 else if (fruit == "pineapple") price = 5.60;
  27.                 else if (fruit == "grapes") price = 4.20;
  28.  
  29.                 Console.WriteLine("{0:f2}", price * quantity);
  30.             }
  31.  
  32.             else if (day == "monday" || day == "tuesday" || day == "wednesday" || day == "thursday" || day == "friday")
  33.             {
  34.                 var price = 0.0;
  35.                 if (fruit == "banana") price = 2.50;
  36.                 else if (fruit == "apple") price = 1.20;
  37.                 else if (fruit == "orange") price = 0.85;
  38.                 else if (fruit == "grapefruit") price = 1.45;
  39.                 else if (fruit == "kiwi") price = 2.70;
  40.                 else if (fruit == "pineapple") price = 5.50;
  41.                 else if (fruit == "grapes") price = 3.85;
  42.  
  43.                 Console.WriteLine("{0:f2}", price * quantity);
  44.             }
  45.                 
  46.             else
  47.             {
  48.                 Console.WriteLine("error");
  49.             }
  50.  
  51.  
  52.         }
  53.     }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement