OOrlin

Fruitshop

Oct 23rd, 2019
473
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. namespace Fruit_Shop
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. String fruit = Console.ReadLine().ToLower();
  10. String day = Console.ReadLine().ToLower();
  11. var quantity = double.Parse(Console.ReadLine());
  12.  
  13. if (day == "monday" || day == "tuesday" || day == "thursday"
  14. || day == "friday" || day == "wednesday")
  15. {
  16. if (fruit == "apple") Console.WriteLine("{0:f2}",quantity * 1.20);
  17. else if (fruit == "banana") Console.WriteLine("{0:f2}", quantity *2.50);
  18. else if (fruit == "orange") Console.WriteLine("{0:f2}", quantity *0.85);
  19. else if (fruit == "grapefruit") Console.WriteLine("{0:f2}", quantity *1.45);
  20. else if (fruit == "kiwi") Console.WriteLine("{0:f2}", quantity *2.70);
  21. else if (fruit == "pinapple") Console.WriteLine("{0:f2}", quantity *5.50);
  22. else if (fruit == "grapes") Console.WriteLine("{0:f2}", quantity *3.85);
  23. else
  24. Console.WriteLine(" error");
  25. }
  26. else if (day =="saturday" || day =="sunday")
  27. {
  28. if (fruit == "apple") Console.WriteLine("{0:f2}", quantity * 1.25);
  29. else if (fruit == "banana") Console.WriteLine("{0:f2}", quantity * 2.70);
  30. else if (fruit == "orange") Console.WriteLine("{0:f2}", quantity * 0.90);
  31. else if (fruit == "grapefruit") Console.WriteLine("{0:f2}", quantity * 1.60);
  32. else if (fruit == "kiwi") Console.WriteLine("{0:f2}", quantity * 3.00);
  33. else if (fruit == "pinapple") Console.WriteLine("{0:f2}", quantity * 5.60);
  34. else if (fruit == "grapes") Console.WriteLine("{0:f2}", quantity * 4.20);
  35. else
  36. Console.WriteLine(" error");
  37.  
  38. }
  39. else
  40. Console.WriteLine(" error");
  41. }
  42. }
  43. }
RAW Paste Data

Adblocker detected! Please consider disabling it...

We've detected AdBlock Plus or some other adblocking software preventing Pastebin.com from fully loading.

We don't have any obnoxious sound, or popup ads, we actively block these annoying types of ads!

Please add Pastebin.com to your ad blocker whitelist or disable your adblocking software.

×