Krasimir_Slavov

Untitled

Nov 4th, 2018
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.67 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 Exam_Wedding_Investment
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. string contractTerm = Console.ReadLine();
  14. string contractType = Console.ReadLine();
  15. bool hasDesert = Console.ReadLine() == "yes";
  16. int paymentMonts = int.Parse(Console.ReadLine());
  17. double price = 0;
  18. switch (contractTerm)
  19. {
  20. case "one":
  21. switch (contractType)
  22. {
  23. case "Small": price = 9.98; break;
  24. case "Middle": price = 18.99; break;
  25. case "Large": price = 25.98; break;
  26. case "ExtraLarge": price = 35.99; break;
  27. }
  28. break;
  29. case "two":
  30. switch (contractType)
  31. {
  32. case "Small": price = 8.58; break;
  33. case "Middle": price = 17.09; break;
  34. case "Large": price = price = 23.59; break;
  35. case "ExtraLarge": price = 31.79; break;
  36. }
  37. break;
  38. }
  39.  
  40. if (hasDesert)
  41. {
  42. price += price <= 10 ? 5.50 : price <= 30 ? 4.35 : 3.85;
  43. }
  44. price *= paymentMonts;
  45.  
  46. if (contractTerm == "two")
  47. {
  48. price *= 0.9625;
  49. }
  50. Console.WriteLine($"{price:F2} lv.");
  51.  
  52. }
  53. }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment