deadlock Message Board
[ July Full List | Reply ]

Re: java help
From Dale on 8 July '01
replying to Re: java help posted by Andrew

>thanks, but what i need DEFINATLY is not going to be a prewritten script. I need to calculate a specific formula, where a person can fill in for the variables T, O, A & R;
>
>[(T - O) x (A/144)] / R = ?


Under appropriate interpretation of "fill in".

See e.g. http://imaginatorium.org/stuff/stops.htm
(Fill in the purple boxes, click Calculate, and there's your answer. You can calculate any expression you like.

OR


<!-- TWO STEPS TO INSTALL
1. Copy the coding into the HEAD of your HTML document
2. Add the last code into the BODY of your HTML document -->


<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com -->

<!-- Begin

// DECLARE AND INITIALIZE VARIABLES
var zero = '0';
var one = '1';
var two = '2';
var three = '3';
var four = '4';
var five = '5';
var six = '6';
var seven = '7';
var eight = '8';
var nine = '9';
var add = '+';
var subtract = '-';
var multiply = '*';
var divide = '/';
var decimal = '.';
var power = '^';

// FUNCTION: compute
function compute(f)
{
f.view.value = eval(f.view.value);
}

// FUNCTION: getNum
function getNum(f, val)
{
f.view.value += val;
}

// End -->

</script>

</HEAD>

<!-- STEP TWO: Copy this code into the BODY of your HTML document -->

<BODY>

<CENTER>
<TABLE CELLPADDING=0 CELLSPACING=0 BORDER=1 BORDERCOLOR=DDDDDD>
<TR><TD>
<TABLE CELLPADDING=7 CELLSPACING=0 BGCOLOR=AABBCC>

<!----------------------BEGIN CALCULATOR------------------------->
<FORM NAME="calc">
<TR>
<TD COLSPAN=2>
<DIV ALIGN=LEFT><SMALL><FONT COLOR=000000>
BG-78 Calculator
</FONT></SMALL></DIV>
<INPUT TYPE=text NAME="view" SIZE=30 action="compute(this)"><BR>
<HR>
</TD>
</TR>

<TR>
<TD COLSPAN=2><DIV ALIGN=RIGHT>
<INPUT TYPE=button VALUE=" 7 " onClick="getNum(this.form, seven)">
<INPUT TYPE=button VALUE=" 8 " onClick="getNum(this.form, eight)">
<INPUT TYPE=button VALUE=" 9 " onClick="getNum(this.form, nine)">
<INPUT TYPE=button VALUE=" . " onClick="getNum(this.form, decimal)">
<INPUT TYPE=reset VALUE=" C ">
</DIV></TD>
</TR>
<TR>
<TD COLSPAN=2><DIV ALIGN=RIGHT>
<INPUT TYPE=button VALUE=" 4 " onClick="getNum(this.form, four)">
<INPUT TYPE=button VALUE=" 5 " onClick="getNum(this.form, five)">
<INPUT TYPE=button VALUE=" 6 " onClick="getNum(this.form, six)">
<INPUT TYPE=button VALUE=" * " onClick="getNum(this.form, multiply)">
<INPUT TYPE=button VALUE=" / " onClick="getNum(this.form, divide)">
</DIV></TD>
</TR>
<TR>
<TD COLSPAN=2><DIV ALIGN=RIGHT>
<INPUT TYPE=button VALUE=" 1 " onClick="getNum(this.form, one)">
<INPUT TYPE=button VALUE=" 2 " onClick="getNum(this.form, two)">
<INPUT TYPE=button VALUE=" 3 " onClick="getNum(this.form, three)">
<INPUT TYPE=button VALUE=" - " onClick="getNum(this.form, subtract)">
<INPUT TYPE=button VALUE=" + " onClick="getNum(this.form, add)">
</DIV></TD>
</TR>
<TR>
<TD><DIV ALIGN=CENTER>
<INPUT TYPE=button VALUE=" 0 " onClick="getNum(this.form, zero)">
</DIV>
</TD>
<TD>
<DIV ALIGN=RIGHT>
<INPUT TYPE=button VALUE=" = " onClick="compute(this.form)">
</DIV>
</TD>
</TR>
<TR>
<TD COLSPAN=2>
<HR>
<CENTER><SMALL><FONT COLOR=000000>
Bryan Gamble Copyright 2001.<BR>
All Rights Reserved.
</FONT></SMALL></CENTER>
</TD>
</TR>
</FORM>
<!------------------------END CALCULATOR---------------------------->

</TABLE>
</TD></TR></TABLE>
</CENTER>


<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by <a href="http://javascriptsource.com">The JavaScript Source</a></font>
</center><p>

<!-- Script Size: 4.05 KB -->




Reply to this message

Required Details
Your name:
Subject:

Optional Details
Home page title:
Home page URL:
Email:
(if you'd like to receive automatic replies by email)

Your Message