<< Chapter < Page Chapter >> Page >

Rearranging the terms

We can rearrange the terms and rewrite this equation as

distance = (63360 * inch * 1*foot * 1 * mile)/(12*inch*5280*foot)

Canceling like terms

Canceling out like terms in the numerator and denominator leaves us with

distance = (63360*mile)/(12*5280)

Doing the arithmetic, we get

distance = 1*mile

(Obviously, I started out with a set of numbers that were designed to cause the final answer to be one mile, but that was simply for convenience.)

There you have it

You have seen a detailed procedure for converting from a distance expressed in paces (for a specific individual) to the same distanceexpressed in miles. Obviously, once you understand the overall procedure, you could omit and/or combine some of the steps to simplify the process.

Using JavaScript to convert units

Let's write, execute, and analyze a script that solves the same problem.

The objective of the script is to convert a distance of 2112 paces to a distance in miles where it is given that

  • 100 paces = 3000 inches
  • 12 inches = 1 foot
  • 5280 feet = 1 mile

Please copy the code from Listing 1 into an html file and open the file in your browser.

Listing 1 . Convert from paces to miles.

>!-- File JavaScript01.html ------------------------------>>html>>body>>script language="JavaScript1.3">var d = 2112 //distance, units = paces document.write("d = " + d + " paces" + "<br/>") var d2 = 3000 //distance, units = inchesvar d3 = 100 //distance, units = paces var f1 = d2/d3 //factor, units = inches/pacedocument.write( "f1 =" + f1 + " inches/pace" + "<br/>") //pace*inch/pace = inchvar d = d *f1 //distance, units = inches document.write("d = " + d + " inches" + "<br/>") var f2 = 1/12 //factor, units = feet/inchdocument.write( "f2 = " + f2 + " feet/inch" + "<br/>") //inch*feet/inch = feetvar d = d *f2 //distance, units = feet document.write("d = " + d + " feet" + "<br/>") var f3 = 1/5280 //factor, units = miles/footdocument.write( "f3 = " + f3 + " miles/foot" + "<br/>") //feet*mile/feet = milevar d = d *f3 //distance, units = miles document.write("d = " + d + " mile" + "<br/>") //Now reverse the process using reciprocals//(pace/inch)*(inch/foot)*(foot/mile) = pace/mile var f4 =(1/f1)*(1/f2)*(1/f3) //factor, units = paces/miledocument.write( "f4 = " + f4 + " paces/mile" + "<br/>") //miles*paces/mile = pacesvar d = d *f4 //distance, units = paces document.write("d = " + d + " paces" + "<br/>") document.write("The End")>/script>>/body>>/html>

Screen output

When you open the html file in your browser, the text shown in Figure 5 should appear in your browser window.

Figure 5 . Screen output for Listing #1.
d = 2112 paces f1 =30 inches/paced = 63360 inches f2 = 0.08333333333333333 feet/inchd = 5280 feet f3 = 0.0001893939393939394 miles/footd = 1 mile f4 = 2112 paces/miled = 2112 paces The End

Discuss the output first

Let's begin our discussion with the screen output shown in Figure 5 and then go back and examine the code that produced that output.

Figure 5 begins with a distance (labeled d ) expressed in units of paces. The value is 2112 paces, which is the distance from your home to your school discussed earlier.

Questions & Answers

how do I set up the problem?
Harshika Reply
what is a solution set?
Harshika
find the subring of gaussian integers?
Rofiqul
hello, I am happy to help!
Shirley Reply
please can go further on polynomials quadratic
Abdullahi
hi mam
Mark
I need quadratic equation link to Alpa Beta
Abdullahi Reply
find the value of 2x=32
Felix Reply
divide by 2 on each side of the equal sign to solve for x
corri
X=16
Michael
Want to review on complex number 1.What are complex number 2.How to solve complex number problems.
Beyan
yes i wantt to review
Mark
use the y -intercept and slope to sketch the graph of the equation y=6x
Only Reply
how do we prove the quadratic formular
Seidu Reply
please help me prove quadratic formula
Darius
hello, if you have a question about Algebra 2. I may be able to help. I am an Algebra 2 Teacher
Shirley Reply
thank you help me with how to prove the quadratic equation
Seidu
may God blessed u for that. Please I want u to help me in sets.
Opoku
what is math number
Tric Reply
4
Trista
x-2y+3z=-3 2x-y+z=7 -x+3y-z=6
Sidiki Reply
can you teacch how to solve that🙏
Mark
Solve for the first variable in one of the equations, then substitute the result into the other equation. Point For: (6111,4111,−411)(6111,4111,-411) Equation Form: x=6111,y=4111,z=−411x=6111,y=4111,z=-411
Brenna
(61/11,41/11,−4/11)
Brenna
x=61/11 y=41/11 z=−4/11 x=61/11 y=41/11 z=-4/11
Brenna
Need help solving this problem (2/7)^-2
Simone Reply
x+2y-z=7
Sidiki
what is the coefficient of -4×
Mehri Reply
-1
Shedrak
the operation * is x * y =x + y/ 1+(x × y) show if the operation is commutative if x × y is not equal to -1
Alfred Reply
An investment account was opened with an initial deposit of $9,600 and earns 7.4% interest, compounded continuously. How much will the account be worth after 15 years?
Kala Reply
lim x to infinity e^1-e^-1/log(1+x)
given eccentricity and a point find the equiation
Moses Reply
A soccer field is a rectangle 130 meters wide and 110 meters long. The coach asks players to run from one corner to the other corner diagonally across. What is that distance, to the nearest tenths place.
Kimberly Reply
Jeannette has $5 and $10 bills in her wallet. The number of fives is three more than six times the number of tens. Let t represent the number of tens. Write an expression for the number of fives.
August Reply
What is the expressiin for seven less than four times the number of nickels
Leonardo Reply
How do i figure this problem out.
how do you translate this in Algebraic Expressions
linda Reply
why surface tension is zero at critical temperature
Shanjida
I think if critical temperature denote high temperature then a liquid stats boils that time the water stats to evaporate so some moles of h2o to up and due to high temp the bonding break they have low density so it can be a reason
s.
Need to simplify the expresin. 3/7 (x+y)-1/7 (x-1)=
Crystal Reply
. After 3 months on a diet, Lisa had lost 12% of her original weight. She lost 21 pounds. What was Lisa's original weight?
Chris Reply
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get the best Algebra and trigonometry course in your pocket!





Source:  OpenStax, Game 2302 - mathematical applications for game development. OpenStax CNX. Jan 09, 2016 Download for free at https://legacy.cnx.org/content/col11450/1.33
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Game 2302 - mathematical applications for game development' conversation and receive update notifications?

Ask