Advertisement
yugecin

Untitled

Nov 20th, 2012
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.74 KB | None | 0 0
  1. If there is a straight section of highway 120 Km between them and Joe travels south towards Bob at 30Kph
  2. while Bob travels north towards Joe at 25Kph, how long will it be before they meet and how far will each have traveled in that time?
  3. (d=r/t where d is distance, r is rate and t is time)
  4.  
  5. Please show all of your work and if possible write a program that solves the problem for any given rates and distances.
  6. Thanks for participating and sharing, please invite your friends who might be interested. I ♥ Math for programming! -JpE-
  7.  
  8. https://www.facebook.com/groups/ILMFP/
  9.  
  10. :: program at bottom ::
  11. -¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯
  12.  
  13. Given: t1 = 0h
  14. t2 = 0h
  15. v1 = 30 km/h
  16. v2 = 25 km/h
  17. s1(t1) = 0 km
  18. s2(t1) = 120 km
  19.  
  20. Wanted: s(t)
  21. t
  22.  
  23. a(joe) b(bob)
  24. -----•.--------------------------•----------------•-.----
  25. s(t1) s(t) s(t1)
  26. ---> v1 v2 <--
  27.  
  28. Solution:
  29.  
  30. ______________________________________________________
  31. (1) ERB Joe
  32.  
  33. Δs1(t1, t) = s1(t) - s1(t1)
  34. s1(t) = s1(t1) + Δs1(t1, t)
  35. s1(t) = s1(t1) + v1.Δt(t1, 1)
  36. s1(t) = s1(t1) + v1.(t-t1)
  37. s1(t) = 0 km + 30 km/h.(t-0h)
  38. s1(t) = 30 km/h . t
  39.  
  40. ______________________________________________________
  41. (2) ERB Bob
  42.  
  43. Δs2(t2, t) = s2(t) - s2(t2)
  44. s2(t) = s2(t2) + Δs2(t2, t)
  45. s2(t) = s2(t2) + v2.Δt(t2, 1)
  46. s2(t) = s2(t2) + v2.(t-t2)
  47. s2(t) = 120 km + -25 km/h.(t-0h)
  48. s2(t) = 120 km - 25 km/h . t
  49.  
  50. ______________________________________________________
  51. (3) s1(t) = s2(t) (meeting point)
  52. 30 km/h . t = 120 km - 25 km/h . t
  53. 55 km/h . t = 120 km
  54. t = 120 km / 55 km/h
  55. t = 2,181818 h (2h 10m 54s)
  56.  
  57. ______________________________________________________
  58. (4) distance Joe
  59.  
  60. s1(t) = 30 km/h . t
  61. = 30 km/h . 2,181818h
  62. = 65,454545 km
  63.  
  64. ______________________________________________________
  65. (5) distance Bob
  66.  
  67. s2(t) = 25 km/h . t
  68. = 25 km/h . 2,181818h
  69. = 54.545454 km
  70.  
  71.  
  72. I ♥ Math for programming!
  73. ~Robin "yugecin" Claerhout
  74.  
  75. -¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯-¯
  76.  
  77. :: Batch program for calculating solution ::
  78. http://pastebin.com/yEUtQQYH
  79. (time function not working properly (yet))
  80. To solve this question:
  81. Joe:
  82. Starting distance: 0
  83. Starting time: 0
  84. Speed: 30
  85. Bob:
  86. Starting Distance: 120
  87. Starting time: 0
  88. Speed: -25 (negative because Bob is travelling to Joe)
  89.  
  90. Output:
  91. Meeting time: 2,181 h
  92. Distance Joe: 65.430 km
  93. Distance Bob: 54.525 km
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement