Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How can I run variables in a math situation

Status
Not open for further replies.

beck

Programmer
Mar 22, 1999
26
0
0
US
I have created a math type of program and want to run variables. A situation would be something like this. The individual would be attempting to calculate a speed for a skidding vehicle. The entries would be the distance the vehicle skids such as 30 feet. The friction for the roadway would be from .75 to .85. What I want to do is provide results with the variable .75 to .85 in increments of .01. The calculation is the sqr(30*Distance*Friction) How do I write it to give the variable results and then display them to the user with the appropriate increment displayed alongside the results.. Any assistance would be greatly appreciated. <p> <br><a href=mailto:accrec@intergrafix.net>accrec@intergrafix.net</a><br><a href= > </a><br>
 
<html>
<head>
<title></title>
</head>
<body>

<cfparam name=startFriction default=&quot;0.75&quot;>
<cfparam name=endFriction default=&quot;0.85&quot;>
<cfparam name=distance default=&quot;30&quot;>

<table>
<cfloop from=#startFriction# To=#endFriction# step=0.01 Index=&quot;Friction&quot;>
<cfoutput>
<tr>
<td>#Friction#</td>
<td><cfset r=sqr(distance * friction)>#r#</td>
</tr>
</cfoutput>
</cfloop>
</table>

</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top