Advertisement
Psychozub

FruitShop

Mar 26th, 2016
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.64 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.             if (day == "monday" || day == "tuesday" || day == "wednesday" || day == "thursday" || day == "friday")
  18.             {
  19.                 if (fruit == "banana")
  20.                 {
  21.                     Console.WriteLine(quantity * 2.50);
  22.                 }
  23.                 else if (fruit == "apple")
  24.                 {
  25.                     Console.WriteLine(quantity * 1.20);
  26.                 }
  27.                 else if (fruit == "orange")
  28.                 {
  29.                     Console.WriteLine(quantity * 0.85);
  30.                 }
  31.                 else if (fruit == "grapefruit")
  32.                 {
  33.                     Console.WriteLine(quantity * 1.45);
  34.                 }
  35.                 else if (fruit == "kiwi")
  36.                 {
  37.                     Console.WriteLine(quantity * 2.70);
  38.                 }
  39.                 else if (fruit == "pineapple")
  40.                 {
  41.                     Console.WriteLine(quantity * 5.50);
  42.                 }
  43.                 else if (fruit == "grapes")
  44.                 {
  45.                     Console.WriteLine(quantity * 3.85);
  46.                 }
  47.             }
  48.             else if (day == "saturday" || day == "sunday")
  49.             {
  50.                 if (fruit == "banana")
  51.                 {
  52.                     Console.WriteLine(quantity * 2.70);
  53.                 }
  54.                 else if (fruit == "apple")
  55.                 {
  56.                     Console.WriteLine(quantity * 1.25);
  57.                 }
  58.                 else if (fruit == "orange")
  59.                 {
  60.                     Console.WriteLine(quantity * 0.90);
  61.                 }
  62.                 else if (fruit == "grapefruit")
  63.                 {
  64.                     Console.WriteLine(quantity * 1.60);
  65.                 }
  66.                 else if (fruit == "kiwi")
  67.                 {
  68.                     Console.WriteLine(quantity * 3.00);
  69.                 }
  70.                 else if (fruit == "pineapple")
  71.                 {
  72.                     Console.WriteLine(quantity * 5.60);
  73.                 }
  74.                 else if (fruit == "grapes")
  75.                 {
  76.                     Console.WriteLine(quantity * 4.20);
  77.                 }
  78.             }
  79.             else
  80.             {
  81.                 Console.WriteLine("error");
  82.             }
  83.         }
  84.     }
  85. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement