Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2017
277
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.37 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 Courier_Express
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var weightShipment = double.Parse(Console.ReadLine());
  14. var service = Console.ReadLine();
  15. var length = double.Parse(Console.ReadLine());
  16. var allPrice = 0.0;
  17.  
  18. if (service == "standard")
  19. {
  20. if (weightShipment < 1)
  21. {
  22. allPrice = length * 0.03;
  23. }
  24. else if (weightShipment >= 1 && weightShipment <= 10)
  25. {
  26. allPrice = length * 0.05;
  27. }
  28. else if (weightShipment >= 11 && weightShipment <= 40)
  29. {
  30. allPrice = length * 0.10;
  31. }
  32. else if (weightShipment >= 41 && weightShipment <= 90)
  33. {
  34. allPrice = length * 0.15;
  35. }
  36. else if (weightShipment >= 91 && weightShipment <= 150)
  37. {
  38. allPrice = length * 0.20;
  39. }
  40. }
  41.  
  42. if (service == "express")
  43. {
  44. if (weightShipment < 1)
  45. {
  46. allPrice = allPrice + 0.8 * 0.03 * length * weightShipment;
  47. }
  48. else if (weightShipment >= 1 && weightShipment <= 10)
  49. {
  50. allPrice = allPrice + 0.4 * 0.05 * length * weightShipment;
  51. }
  52.  
  53. else if (weightShipment >= 11 && weightShipment <= 40)
  54. {
  55. allPrice = allPrice + 0.05 * 0.10 * length * weightShipment;
  56. }
  57.  
  58. else if (weightShipment >= 41 && weightShipment <= 90)
  59. {
  60. allPrice = allPrice + 0.02 * 0.15 * length * weightShipment;
  61. }
  62.  
  63. else if (weightShipment >= 91 && weightShipment <= 150)
  64. {
  65. allPrice = allPrice + 0.01 * 0.20 * length * weightShipment;
  66. }
  67. }
  68.  
  69. Console.WriteLine("The delivery of your shipment with weight of {0:f3} kg. would cost {0:f2} lv.", weightShipment, allPrice);
  70. }
  71. }
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement