SHARE
TWEET

FruitShop

a guest Feb 24th, 2020 70 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace _08.FruitShop
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string fruit = Console.ReadLine();
  10.             string dayOfWeek = Console.ReadLine();
  11.             double price = double.Parse(Console.ReadLine());
  12.             double quantity = 0;
  13.  
  14.             if (fruit == "banana")
  15.             {
  16.                 if (dayOfWeek == "Monday" || dayOfWeek == "Tuesday" || dayOfWeek == "Wednesday" || dayOfWeek == "Thursday" || dayOfWeek == "Friday")
  17.                 {
  18.                     price = 2.50;
  19.                 }
  20.                 else if (dayOfWeek == "Saturday" || dayOfWeek == "Sunday")
  21.                 {
  22.                     price = 2.70;
  23.                 }
  24.             }
  25.             else if (fruit == "apple")
  26.             {
  27.                 if (dayOfWeek == "Monday" || dayOfWeek == "Tuesday" || dayOfWeek == "Wednesday" || dayOfWeek == "Thursday" || dayOfWeek == "Friday")
  28.                 {
  29.                     price = 1.20;
  30.                 }
  31.                 else if (dayOfWeek == "Saturday" || dayOfWeek == "Sunday")
  32.                 {
  33.                     price = 1.25;
  34.                 }
  35.             }
  36.             else if (fruit == "orange")
  37.             {
  38.                 if (dayOfWeek == "Monday" || dayOfWeek == "Tuesday" || dayOfWeek == "Wednesday" || dayOfWeek == "Thursday" || dayOfWeek == "Friday")
  39.                 {
  40.                     price = 0.85;
  41.                 }
  42.                 else if (dayOfWeek == "Saturday" || dayOfWeek == "Sunday")
  43.                 {
  44.                     price = 0.90;
  45.                 }
  46.             }
  47.             else if (fruit == "grapefruit")
  48.             {
  49.                 if (dayOfWeek == "Monday" || dayOfWeek == "Tuesday" || dayOfWeek == "Wednesday" || dayOfWeek == "Thursday" || dayOfWeek == "Friday")
  50.                 {
  51.                     price = 1.45;
  52.                 }
  53.                 else if (dayOfWeek == "Saturday" || dayOfWeek == "Sunday")
  54.                 {
  55.                     price = 1.60;
  56.                 }
  57.             }
  58.             else if (fruit == "kiwi")
  59.             {
  60.                 if (dayOfWeek == "Monday" || dayOfWeek == "Tuesday" || dayOfWeek == "Wednesday" || dayOfWeek == "Thursday" || dayOfWeek == "Friday")
  61.                 {
  62.                     price = 2.70;
  63.                 }
  64.                 else if (dayOfWeek == "Saturday" || dayOfWeek == "Sunday")
  65.                 {
  66.                     price = 3.00;
  67.                 }
  68.             }
  69.             else if (fruit == "pineapple")
  70.             {
  71.                 if (dayOfWeek == "Monday" || dayOfWeek == "Tuesday" || dayOfWeek == "Wednesday" || dayOfWeek == "Thursday" || dayOfWeek == "Friday")
  72.                 {
  73.                     price = 5.50;
  74.                 }
  75.                 else if (dayOfWeek == "Saturday" || dayOfWeek == "Sunday")
  76.                 {
  77.                     price = 5.60;
  78.                 }
  79.             }
  80.             else if (fruit == "grapes")
  81.             {
  82.                 if (dayOfWeek == "Monday" || dayOfWeek == "Tuesday" || dayOfWeek == "Wednesday" || dayOfWeek == "Thursday" || dayOfWeek == "Friday")
  83.                 {
  84.                     price = 3.85;
  85.                 }
  86.                 else if (dayOfWeek == "Saturday" || dayOfWeek == "Sunday")
  87.                 {
  88.                     price = 4.20;
  89.                 }
  90.             }
  91.             else
  92.             {
  93.                 Console.WriteLine("error");
  94.             }
  95.  
  96.             Console.WriteLine($"{quantity * price:F2}");
  97.         }
  98.     }
  99. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top