Advertisement
Guest User

Untitled

a guest
Jul 2nd, 2017
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.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 _04
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var fruit = Console.ReadLine();
  14. var size = Console.ReadLine();
  15. var quantity = double.Parse(Console.ReadLine());
  16. var big = 5;
  17. var small = 2;
  18.  
  19. var price = 0.0;
  20.  
  21. switch (size)
  22. {
  23. case "small":
  24. {
  25. switch (fruit)
  26. {
  27. case "Watermelon": price = 56.00 * small; break;
  28. case "Mango": price = 36.66 * small; break;
  29. case "Pineapple": price = 42.10 * small; break;
  30. case "Raspberry": price = 20.00 * small; break;
  31.  
  32. }
  33. break;
  34. }
  35. case "big":
  36. {
  37. switch (fruit)
  38. {
  39. case "Watermelon": price = 28.70 * big; break;
  40. case "Mango": price = 19.60 * big; break;
  41. case "Pineapple": price = 24.80 * big; break;
  42. case "Raspberry": price = 15.20 * big; break;
  43. }
  44. break;
  45. }
  46. }
  47. var totalPrice = price * quantity;
  48.  
  49. if (totalPrice >= 400 && totalPrice <= 1000)
  50. {
  51. totalPrice = totalPrice * 0.85;
  52. Console.WriteLine($"{totalPrice:f2} lv.");
  53. }
  54. else if (totalPrice > 1000)
  55. {
  56. totalPrice = totalPrice * 0.50;
  57. Console.WriteLine($"{totalPrice:f2} lv.");
  58. }
  59. else
  60. {
  61. Console.WriteLine($"{totalPrice:f2} lv.");
  62. }
  63. }
  64. }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement