degree measurement conversion--Temperature conversion

Source: Internet
Author: User
Tip: You can modify some of the code before running

<ptml> <pead> <meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "> <title> degree Measurement conversion--Temperature conversion </title> <script Language=jscript> <!--var k=273.15; var ct=0; var temp=0; var choice=0; var cap1=new Array (6); cap1[0]= "Celsius"; cap1[1]= "degrees Fahrenheit"; cap1[2]= "Open degree"; cap1[3]= "Blue degree"; cap1[4]= "column degree"; cap1[5]= "Celsius"; var cap2=new Array (10); cap2[0]= "Fahrenheit" cap2[1]= "cap2[2]=" cap2[3]= "degree" cap2[4]= "degrees Celsius" cap2[5]= "Fahrenheit" cap2[6]= "open degree" cap2[7]= "Blue degree" cap2[8. ]= "cap2[9]=" "degree Celsius" <!--temperature array--> var t=new ARRAY (12); t[0]=0; t[1]=0; t[2]=0; t[3]=0; t[4]=0; t[5]=0; t[6]=0; t[7]=0; t[8]=0; t[9]=0; t[10]=0; t[11]=0; Function Calc (boxes) {document.boxes.b1a.value= (Cap1[choice]); document.boxes.b2a.value= (Cap2[choice)); Document.boxes.b3a.value= (cap2[choice+1]); Document.boxes.b4a.value= (cap2[choice+2]); Document.boxes.b5a.value= (cap2[choice+3]); <!--converting input number to kelvin--> temp=eval (Document.inbox.b0.value); document.boxes.b1.value=temp; if (choice==0) {temp=temp + k}; if (choice==1) {temp= (TEMP-32)/1.8) +273.15}; if (choice==2) {temp=temp*1}; if (choice==3) {temp=temp/1.8}; if (choice==4) {temp= (temp*1.25) +273.15}; if (choice==5) {}; if (choice==0) {ct=1} if (choice==1) {ct=2} if (choice==2) {ct=3} if (choice==3) {ct=4} if (choice==4) {ct=5} if (choice==5) {C T=6} t[0]= (temp-273.15); t[1]= (temp-273.15) *1.8 + 32; t[2]= (temp); t[3]=temp*1.8; t[4]= (temp-273.15)/1.25; t[5]=temp-273.15; t[6]= (temp-273.15) *1.8 + 32; t[7]= (temp); T[8]= (temp*1.8); t[9]= (temp-273.15)/1.25; T[10]= (temp-273.15); t[11]= (temp-273.15) *1.8 + 32; document.boxes.b2.value=t[ct];ct=ct+1; document.boxes.b3.value=t[ct];ct=ct+1; document.boxes.b4.value=t[ct];ct=ct+1; document.boxes.b5.value=t[ct];ct=ct+1; //--> </SCRIPT> </pead> <body class= "BodyColor" topmargin= "5" > <table width= "100%" border= "0" cellpadding=0 cellspacing=0 class= "small" > <TBODY> <TR> &LT;TD valign= "Top" ><br> <table width= "75%" border= "0" align= "center" Cellpadd ing= "0" cellspacing= "0" class= "small" > <tr> <td> can be implemented Now degrees Celsius (Celsius equals), Fahrenheit (Farenheit equals), open degrees (KELVIN equals), Rand (RANKINE equals), Lei degrees (Reaumur equals) The five temperature measurement units of the interchange between the two. </td> </tr> </table> <br&gt ; <table width= "75%" border= "0" align= "center" cellpadding= "0" cellspacing= "0" class= "small" > <tr> <td> <strong> temperature values to be converted:</strong> </td> </tr> <tr> ;td> <form name=inbox> <input name=b0 type=number C Lass= "Smallinput" size=6>   type: <input onclick= "choice=0; Calc (); return true "Type=button size=5 value= degrees Celsius class= ' Smallbutton ' name=button>  <input ' onclick=" choice=1; Calc (); return true "Type=button size=5 value= Fahrenheit class= ' Smallbutton ' name=button>  <input ' onclick=" choice=2; Calc (); return true "Type=button size=5 value= degrees class= ' Smallbutton ' name=button>  <input ' onclick=" choice=3; Calc (); return true "Type=button size=5 value= rand class= ' Smallbutton ' name=button>  <input ' onclick=" choice=4; Calc (); return true "Type=button size=5 value= class= ' Smallbutton ' name=button> </FORM> </td> </tr> <tr> < td><strong> conversion Results:</strong></td> </tr> &LT;TR > <td> <form name=boxes> <input name=b1 type=number class= "Smallinput" size=15> <input name=b1a Type=number class= "Smallinput" size=8>   |   <inpu T name=b2 type=number class= "Smallinput" size=15> "<input" name=b2a type=number class= "SmallInput" size=8> <br><input name=b3 type=number class= "Smallinput" size=15> <i Nput name=b3a type=number class= "Smallinput" size=8>   |   <input NAME=B4 type=number class= smallinput "size=15> <input name=b4a type=number class=" SmallInpu T "size=8> <br><input name=b5 type=number class=" Smallinput "size=15> <input name=b5a Type=number class= "Smallinput" size=8> <BR> <br><input onclick=clearform (this.form) type=reset value= data reset class= ' SmallButton ' name=reset> </UL></FORM> </td> < /tr> <tr> <td> </td> </tr> </table> <BR> </tr></tbody ></TABLE> </body> </ptml>
Tip: You can modify some of the code before running

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.