Advertisement
arsenalkoo

03.Courier Express

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