Skip to content

Instantly share code, notes, and snippets.

@Ashvith07
Created September 5, 2015 12:28
Show Gist options
  • Save Ashvith07/defa1031fa272b8bdffa to your computer and use it in GitHub Desktop.
Save Ashvith07/defa1031fa272b8bdffa to your computer and use it in GitHub Desktop.
<html>
<head>
<title> The Age Calculator</title>
</head>
<body>
<script language="JavaScript">
function CalculateAge()
{
var birthyear = document.form1.txt.value;
var currentyear = new Date();
var age = currentyear.getFullYear();
document.write('They are either ' + (age-birthyear)+ ' or ' + (age-birthyear - 1));
}
</script>
<form name=form1>
Enter the Birth Year
<input type="text" name="txt" size=10>
<br>
<input type="button" value="Calculate" onClick='CalculateAge();'>
</form>
</body>
</html>
<html>
<head>
<title> The Geometrizer.</title>
</head>
<body>
<script language="JavaScript">
function CalcArea(){
var radius =document.form1.txtRadius.value;
document.write("<P>The area of the circle is " + (radius * radius * Math.PI) + "</p>");
}
function Calccircum(){
var radius =document.form2.txtRadius.value;
document.write("<P>The circumference of the circle is " + (2 * radius * Math.PI) + "</p>");
}
</script>
<form name=form1>
Enter the radius of circle to <br>calculate Arera of circle:
<input type="text" name="txtRadius" size=10>
<br>
<input type="button" value="Calculate" onClick='CalcArea();'>
</form>
<form name=form2>
Enter the radius of circle to <br> calculate Circumference of circle:
<input type="text" name="txtRadius" size=10>
<br>
<input type="button" value="Calculate" onClick='Calccircum();'>
</form>
</script>
</body>
</html>
<html>
<head>
<title> The Lifetime Supply Calculator.</title>
</head>
<body>
<script language="JavaScript">
function CalculateSupply()
{
var age = 28;
var maxAge = 100;
var amountPerDay = document.form1.txt.value;
document.write('You will need ' + ((amountPerDay * 365) * (maxAge - age)) + ' Snacks to last you until the ripe old age of ' + maxAge);
}
</script>
<form name=form1>
Enter the Snacks:
<input type="text" name="txt" size=10>
<br>
<input type="button" value="Calculate" onClick='CalculateSupply();'>
</form>
</body>
</html>
<html>
<head> <title> Presentation</title>
<script language="JavaScript">
function CalculateAge()
{
var birthyear = document.form1.txt.value;
var currentyear = new Date();
var age = currentyear.getFullYear();
document.write('They are either ' + (age-birthyear)+ ' or ' + (age-birthyear - 1));
}
function CalculateSupply()
{
var age = 28;
var maxAge = 100;
var amountPerDay = document.form2.txt.value;
document.write('You will need ' + ((amountPerDay * 365) * (maxAge - age)) + ' Snacks to last you until the ripe old age of ' + maxAge);
}
function CalcArea(){
var radius =document.form3.txtRadius.value;
document.write("<P>The area of the circle is " + (radius * radius * Math.PI) + "</p>");
}
function Calccircum(){
var radius =document.form4.txtRadius.value;
document.write("<P>The circumference of the circle is " + (2 * radius * Math.PI) + "</p>");
}
function celsiusToFahrenheit(){
var celsius =document.form5.txt.value;
document.write("<P> Fahrenheit " + (celsius *1.8+32) + "</p>");
}
function fahrenheitToCelsius(){
var radius =document.form6.txt.value;
document.write("<P> Celsius is " + (radius-32)*1.8 + "</p>");
}
</script>
</head>
<body bgcolor="F0FFFF">
<center><h1>Daily Calculator</h1></center>
<form name=form1>
<p><h2><strong><u> Birth Date Calculator</u></strong></h2></p>
<p><h4>Calculate your age in years. How old am I calculator that helps you find years that have passed since your time of birth.<br> In other words how much time you have lived in our mother earth. Also Calculate ur Current Age.</h4></p>
<center> Enter the Birth Year
<input type="text" name="txt" size=10>
<br>
<input type="button" value="Calculate" onClick='CalculateAge();'>
</center> </form>
<form name=form2>
<p><h2><strong><u> Life time Supply Calculator</u></strong></h2></p>
<p><h4>Ever wonder how much a "lifetime supply" of your favorite snack is? wonder no more calculate ur daily snacks till now.</h4></p>
<center> Enter the Snacks:
<input type="text" name="txt" size=10>
<br>
<input type="button" value="Calculate" onClick='CalculateSupply();'>
</center> </form>
<form name=form3>
<p><h2><strong><u>Circle Calculator</u></strong></h2></p>
<h4><i>Area of Circle :</i></h4>
<p><h4>All of the area within the boundary of the circle, expressed as a square of the unit of measurement (square mm, square feet, etc.).<br> The area can be found by multiplying PI (3.14159) times the radius times the radius again. </h4></p>
<center> Enter the radius of circle to <br>calculate Arera of circle:
<input type="text" name="txtRadius" size=10>
<br>
<input type="button" value="Calculate" onClick='CalcArea();'> </center>
</form>
<form name=form4>
<h4><i> Circumfrence of Circle :</i></h4>
<p><h4>The distance around the outward boundary of a circle, expressed as a linear unit of measurement (millimeters, inches, etc.).<br> The circumference can be found by multiplying PI (3.14159) times the diameter. </h4></p>
<center> Enter the radius of circle to <br> calculate Circumference of circle:
<input type="text" name="txtRadius" size=10>
<br>
<input type="button" value="Calculate" onClick='Calccircum();'>
</center> </form>
<form name=form5>
<h2><strong><u> Temperature Conversion</u></strong></h2>
<p><h4>Temperature Conversion Calculator is an online tool to convert temperature from Fahrenheit to Celsius and vice-verse.<br> It is a tool which makes calculations easy and fun. If temperature is given in Fahrenheit then it can easily convert it into <br> Celsius also if temperature is given in Celsius then it can easily convert it into Fahrenheit. </h4></p>
<h4><i> Convert Celsius to Fahrenheit :</i></h4>
<center> Enter the celsius to <br>calculate Fahrenheit:
<input type="text" name="txt" size=10>
<br>
<input type="button" value="Calculate" onClick='celsiusToFahrenheit();'>
</center> </form>
<form name=form6>
<h4><i> Convert Fahrenheit :</i></h4>
<center> Enter the Fahrenheit to <br> calculate celsius:
<input type="text" name="txt" size=10>
<br>
<input type="button" value="Calculate" onClick='fahrenheitToCelsius();'>
</center> </form>
</body>
</html>
<html>
<head>
<title> The Temperature Converter.</title>
</head>
<body>
<script language="JavaScript">
function celsiusToFahrenheit(){
var celsius =document.form1.txt.value;
document.write("<P> Fahrenheit " + (celsius *1.8+32) + "</p>");
}
function fahrenheitToCelsius(){
var radius =document.form2.txt.value;
document.write("<P> Celsius is " + (radius-32)*1.8 + "</p>");
}
</script>
<form name=form1>
Enter the celsius to <br>calculate Fahrenheit:
<input type="text" name="txt" size=10>
<br>
<input type="button" value="Calculate" onClick='celsiusToFahrenheit();'>
</form>
<form name=form2>
Enter the Fahrenheit to <br> celsius:
<input type="text" name="txt" size=10>
<br>
<input type="button" value="Calculate" onClick='fahrenheitToCelsius();'>
</form>
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment