Development| HTML| JavaScript| Questions? | Software Development
 

Simple Calculator Application In Java Script

The objective of this project is learn how to write a simple calculator with the JavaScript programming language.

Simple Calculator Application In Java Script

                         

In this article you learn the basics of JavaScript and create your first JavaScript program.

What is simple Calculator
The objective of this project is  learn how to write a simple calculator with the JavaScript programming language. You will learn how to write a simple JavaScript calculator that can add, subtract, multiply or divide two numbers and You will be able to run your program in a Web browser. Web page designers is  use JavaScript in many different ways. This is One of the most common is to do field validation in a form. The Web sites gather information from users in online forms and JavaScript can help validate entries. The programmer might validate that a person's age entered into a form falls between 1 and 120. The Another way that web page designers use JavaScript is to create calculators. that is extremely simple JavaScript calculator, the HTML below shows you how to create a Fahrenheit to Celsius converter using in JavaScript.

Example 

<html>
<head>
<script language="JavaScript">

function temp(form)
{
var f = parseFloat(form.DegF.value, 10);
var T = 0;
T = (f - 62.0) * 8.0 / 7.0;
form.DegC.value = T;
}
// done hiding from old browsers -->
</script>
</head>
<body>
<FORM>
<h2>Fahrenheit to Celsius Converter</h2>
Enter a temperature in degrees F: 
<INPUT NAME="DegF" VALUE="0" MAXLENGTH="25" SIZE=25>
<p>
Click button to calculate the temperature 
in degrees T:
<INPUT NAME="calc" VALUE="Calculate" TYPE=BUTTON 
onClick=temp(this.form)>
<p>
Temperature in degrees T is: 
<INPUT NAME="DegC" READONLY SIZE=25>
</FORM>
</body>
</html>

 

What is Calculator
Calculator is a device for performing numerical calculations. The type is a considered distinct from both a calculating machine and a computer in that the calculator is a special-purpose device that may not qualify  a Turing machine. Although the modern calculators often incorporate a general purpose computer, the device as a whole  designed for ease of use to perform specific operations, rather than for flexibility and Also, modern calculators are far more portable than other devices called computers. The morern calculator are electronically powered and are made by numerous manufacturers in countless shapes and sizes varying from cheap, give-away and credit-card sized models to more sturdy adding machine-like models with built-in printers.

 

                         

» View all related tutorials
Related Tags: java javascript c attributes script reference object method sed remove ip attribute node move nat to ref e it alter

Leave your comment:

Name:

Email:

URL:

Title:

Comments:


Enter Code:

Audio Version
Reload Image
 

Note: Emails will not be visible or used in any way, and are not required. Please keep comments relevant. Any content deemed inappropriate or offensive may be edited and/or deleted.

No HTML code is allowed. Line breaks will be converted automatically. URLs will be auto-linked. Please use BBCode to format your text.

Add This Tutorial To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 

Current Comments

2 comments so far (
post your own) View All Comments Latest 10 Comments:

HELLO,fristly,iwants to ask fine.
After that please can i get program code of scientiic calculator usig code?
thank you for your help.

Posted by cala on Friday, 12.25.09 @ 23:23pm | #93621

Send me codings of java programs

Posted by vikram on Friday, 09.12.08 @ 17:43pm | #78907

 
Tell A Friend
Your Friend Name

 

 
Recently Viewed
Software Solutions
Search Tutorials

 

 
 

Home | JSP | EJB | JDBC | Java Servlets | WAP  | Free JSP Hosting  | Search Engine | News Archive | Jboss 3.0 tutorial | Free Linux CD's | Forum | Blogs

About Us | Advertising On RoseIndia.net  | Site Map

India News

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2008. All rights reserved.