Guest User

Untitled

a guest
Nov 22nd, 2017
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.70 KB | None | 0 0
  1. <html>
  2. <head>
  3. <title>Test</title>
  4. </head>
  5. <body >
  6. <! Age Calculator Start-->
  7.  
  8. <h2>Age Calculator</h2>
  9. <label for="birthyear">Birth Year</lable>
  10. <input type="text" id="birthyear"><br><br>
  11. <label for="Year">Current Year</lable>
  12. <input type="text" id="curryear" onFocus="curyear()">
  13. <h4>Your Age is </h4><h3 id="result"></h3>
  14. <input type="button" id="calculate" value="Calculate" onClick="Agecalculate()">
  15.  
  16. <! Age Calculator End-->
  17.  
  18. <! Supply Calculator Start-->
  19.  
  20. <h2>Supply Calculator</h2>
  21. <label for="snack">Enter Your Fav Snack</lable>
  22. <input type="text" id="snack"><br><br>
  23. <label for="age">Age</lable>
  24. <input type="text" id="age"><br><br>
  25. <label for="amt">Amount Per Day</lable>
  26. <input type="text" id="amt">
  27. <h4>Your Estimated Comsumption by your favourite</h4><h4 id="SnackName"></h4><h4> is </h4><h3 id="SnackResult"></h3>
  28. <input type="button" id="Supcalculate" value="Calculate" onClick="Supcalculate()">
  29.  
  30. <! Supply Calculator End-->
  31.  
  32. <! Circle Properties Calculator Start-->
  33.  
  34. <h2>Circle Properties Calculator</h2>
  35. <label for="cir">Enter the Radius</lable>
  36. <input type="text" id="rad"><br><br>
  37. <h2>Circumference</h2>
  38. <h4>Circumference is </h4><h3 id="Circum"></h3>
  39. <h2>Area</h2>
  40. <h4>Area is </h4><h3 id="Area"></h3>
  41. <input type="button" id="Circlecalculate" value="Calculate" onClick="Circle()">
  42.  
  43. <! Circle Properties Calculator End-->
  44.  
  45. <! Temperature Calculator Start-->
  46.  
  47. <h2>Temperature Calculator</h2>
  48. <h1> F - C </h1>
  49. <label for="temp">Farenheit</lable>
  50. <input type="text" id="far" onchange="TempFC()"><br><br>
  51. <label for="temp">Celcius</lable>
  52. <input type="text" id="cel"><br><br>
  53. <br>
  54. <h1> C - F </h1>
  55. <label for="temp">Celcius</lable>
  56. <input type="text" id="cel1" onchange="TempCF()"><br><br>
  57. <label for="temp">Farenheit</lable>
  58. <input type="text" id="far1"><br><br>
  59.  
  60. <! Temperature Calculator End-->
  61.  
  62. </body>
  63. <script language="javascript" type="text/javascript">
  64.  
  65. /* Age Calculator Script Start */
  66.  
  67. function Agecalculate()
  68. {
  69. var a,b,c;
  70. a=document.getElementById('birthyear').value;
  71. b=document.getElementById('curryear').value;
  72. c=b-a;
  73. document.getElementById('result').innerHTML=c;
  74. }
  75.  
  76. function curyear()
  77. {
  78. var d= new Date();
  79. var y= d.getFullYear();
  80. document.getElementById("curryear").value=y;
  81. }
  82.  
  83. /* Age Calculator Script End */
  84.  
  85. /* Supply Calculator Script Start */
  86.  
  87. function Supcalculate()
  88. {
  89. var a,b,c,name,n;
  90. name=document.getElementById('snack').value;
  91. a=document.getElementById('age').value;
  92. b=document.getElementById('amt').value;
  93. n=2080-a;
  94. c=365*n*b;
  95. document.getElementById('SnackName').innerHTML=name;
  96. document.getElementById('SnackResult').innerHTML="Rs."+c;
  97.  
  98. }
  99.  
  100. /* Supply Calculator Script End */
  101.  
  102. /* Circle Properties Calculator Script Start */
  103.  
  104. function Circle()
  105. {
  106. var r,b,c;
  107. r=document.getElementById('rad').value;
  108. b=3.14*r*r;
  109. c=2*3.14*r;
  110. document.getElementById('Circum').innerHTML=b;
  111. document.getElementById('Area').innerHTML=c;
  112. }
  113.  
  114. /* Circle Properties Calculator Script End */
  115.  
  116. /* Temperature Calculator Script Start */
  117.  
  118. function TempFC()
  119. {
  120. var a,b;
  121. a=document.getElementById('far').value;
  122. b=(((a-32)*5)/9);
  123. document.getElementById('cel').value=b;
  124. }
  125.  
  126. function TempCF()
  127. {
  128. var d,e;
  129. d=document.getElementById('cel1').value;
  130. e=(((d*9)/5)+32);
  131. document.getElementById('far1').value=e;
  132. }
  133.  
  134. /* Temperature Calculator Script End */
  135.  
  136. </script>
  137. </html>
Add Comment
Please, Sign In to add comment