Web Development Exercise 4-5
Create an all in one sticky form to solve the common “two trains are moving toward each other” word problem,. The form should have three inputs, all numbers greater than 0: the speed of Train A($SpeedA), the speed of train b($SpeedB) and the distance between the two trains($Distance). For this problem, you will need the following equations:
$DistanceA = (($SpeedA / $SpeedB) * $Distance) /
(1 + ($SpeedA / $SpeedB));
$DistanceB = $Distance – $DistanceA;
$TimeA = $DistanceA / $SpeedB;
$TimeB = $DistanceB / $SpeedB;
In the preceding equations, $DistanceA and $DistanceB are the distances traveled by Trains A and B, respectively.; $TimeA and $TimeB are how long trains and A and B traveled, respectively($Time A should equal $TimeB). If $SpeedA or $Speed B is allowed to be 0, php will display a division by zero not allowed” error.
Save the document as TWoTrains.php directory for chapter 4.
"You need a similar assignment done from scratch? Our qualified writers will help you with a guaranteed AI-free & plagiarism-free A+ quality paper, Confidentiality, Timely delivery & Livechat/phone Support.
Discount Code: CIPD30
Click ORDER NOW..


