Calculator  
 
This is a collection of scripts that may be used for building interactive courseware. You can use the scripts for free. However, we would be happy if you could mention the source in the acknowledgements.  
A simple calculator
C A L C U L A T O R
   

Advanced samples are here and here!

Description 
Maybe a bit difficult to use, but very simple to program. There is no script section. All actions are called from the "onClick"-element of the buttons from within the form
The source  
<FORM> 
<TABLE BORDER=4 CELLPADDING=10 > 
<TR ALIGN=CENTER BGCOLOR=c0c0c0> 
<TD COLSPAN="5"><B>C A L C U L A T O R</B></TD></TR> 

<TR BGCOLOR="#E2E2E2" ALIGN=CENTER> 
<TD><INPUT type=text name=first value=1 size=7></TD> 

<TD><INPUT type=button value=" + " onClick="this.form.result.value=parseFloat(this.form.first.value) + parseFloat(this.form.second.value)"> 
<INPUT type=button value=" - " onClick="this.form.result.value=parseFloat(this.form.first.value) - parseFloat(this.form.second.value)"> 
<INPUT type=button value=" * " onClick="this.form.result.value=parseFloat(this.form.first.value) * parseFloat(this.form.second.value)"> 
<INPUT type=button value=" / " onClick="if(parseFloat(this.form.second.value)!=0){this.form.result.value=parseFloat(this.form.first.value) / parseFloat(this.form.second.value)}else{this.form.result.value='Error'}"> 
</TD> 
<TD><INPUT type=text value=1 name=second size=7></TD> 
<TD>= </TD> 
<TD><INPUT type=TEXT value=" 2 " name=result size=7></TD> 
</TR> 
</TABLE> 
</FORM> 
 

 

Stefan Krumm  
Institut für Geologie, Schloßgarten 5, 91054 Erlangen  
krumm@geol.uni-erlangen.de