Advertisement
Guest User

Untitled

a guest
Jul 6th, 2016
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.03 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 FruitShop
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. String type = Console.ReadLine().ToLower();
  14. String day = Console.ReadLine().ToLower();
  15. double ammount = double.Parse(Console.ReadLine());
  16.  
  17. if (day.Equals("sunday") || day.Equals("saturday"))
  18. {
  19. switch (type)
  20. {
  21. case "banana":
  22. Console.WriteLine("{0:0.00}",2.70 * ammount);
  23. break;
  24. case "apple":
  25. Console.WriteLine("{0:0.00}",1.25 * ammount);
  26. break;
  27. case "orange":
  28. Console.WriteLine("{0:0.00}",0.90 * ammount);
  29. break;
  30. case "grapefruit":
  31. Console.WriteLine("{0:0.00}",1.60 * ammount);
  32. break;
  33. case "kiwi":
  34. Console.WriteLine("{0:0.00}",3.00* ammount);
  35. break;
  36. case "pineapple":
  37. Console.WriteLine("{0:0.00}",5.60 * ammount);
  38. break;
  39. case "grapes":
  40. Console.WriteLine("{0:0.00}",4.20 * ammount);
  41. break;
  42. default:
  43. Console.WriteLine("error");
  44. break;
  45. }
  46. }
  47. else if (day == "monday" || day == "tuesday" || day == "wednesday" || day == "thursday" || day == "friday")
  48. {
  49. switch (type)
  50. {
  51. case "banana":
  52. Console.WriteLine("{0:0.00}",2.50 * ammount);
  53. break;
  54. case "apple":
  55. Console.WriteLine("{0:0.00}",1.20 * ammount);
  56. break;
  57. case "orange":
  58. Console.WriteLine("{0:0.00}",0.85 * ammount);
  59. break;
  60. case "grapefruit":
  61. Console.WriteLine("{0:0.00}",1.45 * ammount);
  62. break;
  63. case "kiwi":
  64. Console.WriteLine("{0:0.00}",2.70 * ammount);
  65. break;
  66. case "pineapple":
  67. Console.WriteLine("{0:0.00}",5.50 * ammount);
  68. break;
  69. case "grapes":
  70. Console.WriteLine("{0:0.00}",3.85 * ammount);
  71. break;
  72.  
  73. default:
  74. Console.WriteLine("error");
  75. break;
  76. }
  77. }
  78. else
  79. {
  80. Console.WriteLine("error");
  81. }
  82. }
  83. }
  84. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement