Advertisement
Guest User

Untitled

a guest
Jan 24th, 2017
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.92 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 ConsoleApplication8
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var fruit = Console.ReadLine().ToLower();
  14. var dayOfWeek = Console.ReadLine().ToLower();
  15. var quantity = double.Parse(Console.ReadLine());
  16.  
  17. if (dayOfWeek == "monday" || dayOfWeek == "tuesday" || dayOfWeek == "wednesday" || dayOfWeek == "thursday" || dayOfWeek == "friday")
  18. {
  19. if (fruit == "banana")
  20. {
  21. Console.WriteLine(Math.Round(quantity * 2.5 , 2));
  22. }
  23. else if (fruit == "apple")
  24. {
  25. Console.WriteLine(Math.Round(quantity * 1.2 , 2));
  26. }
  27. else if (fruit == "orange")
  28. {
  29. Console.WriteLine(Math.Round(quantity * 0.85 , 2));
  30. }
  31. else if (fruit == "grapefruit")
  32. {
  33. Console.WriteLine(Math.Round(quantity * 1.45 , 2));
  34. }
  35. else if (fruit == "kiwi")
  36. {
  37. Console.WriteLine(Math.Round(quantity * 2.7 , 2));
  38. }
  39. else if (fruit == "pineapple")
  40. {
  41. Console.WriteLine(Math.Round(quantity * 5.5 , 2));
  42. }
  43. else if (fruit == "grapes")
  44. {
  45. Console.WriteLine(Math.Round(quantity * 3.85 , 2));
  46. }
  47. }
  48. else if (dayOfWeek == "saturday" || dayOfWeek == "sunday")
  49. {
  50.  
  51. if (fruit == "banana")
  52. {
  53. Console.WriteLine(Math.Round(quantity * 2.7 , 2));
  54. }
  55. else if (fruit == "apple")
  56. {
  57. Console.WriteLine(Math.Round(quantity * 1.25 , 2));
  58. }
  59. else if (fruit == "orange")
  60. {
  61. Console.WriteLine(Math.Round(quantity * 0.9 , 2));
  62. }
  63. else if (fruit == "grapefruit")
  64. {
  65. Console.WriteLine(Math.Round(quantity * 1.6 , 2));
  66. }
  67. else if (fruit == "kiwi")
  68. {
  69. Console.WriteLine(Math.Round(quantity * 3.00 , 2));
  70. }
  71. else if (fruit == "pineapple")
  72. {
  73. Console.WriteLine(Math.Round(quantity * 5.6 , 2));
  74. }
  75. else if (fruit == "grapes")
  76. {
  77. Console.WriteLine(Math.Round(quantity * 4.2 , 2));
  78. }
  79.  
  80. }
  81. else
  82. {
  83. Console.WriteLine("error");
  84. }
  85.  
  86.  
  87. }
  88. }
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement