Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Javascript Calculator Program

This topic is 5745 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hey guys! I am an amateur programmer(Aside from HTML i only know some java-script and little tiny bits of C++). I have created programs in java-script that will find the volume of a cylender, area of a circle given either the diameter or radius, volume of a cube, area of a square given the length of one side, you get the point.... My next project i''m aiming to make a standard four-function calculator (*,/,+,-). Plan "A" is to make virtually a replica of windows calculator, where you can click on say number "1" and and 1 will appear inthe text box (except just the four primary functions, not anything else)Unfortunatly this may be a little over my head... Plan "B" is to have the text bar at the top where the user imputs the numbers directly into the bar and then will click the *,/,+, -, or = buttons below it. If anyone could tell me how to get numbers into the computer other than by an Internet Explorer command prompt(preferably by typing them into the text box and hitting one of the four functions), that would be greatly appreciated. (Oh and if any other novice like me would like to work with me on this, e-mail me at chillers2000@comcast.net) Thanks a lot!

Share this post


Link to post
Share on other sites
Advertisement
quote:
If anyone could tell me how to get numbers into the computer other than by an Internet Explorer command prompt


you can read keyboard presses by editing this code


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

function keys()
{
alert(event.keyCode);
}



</script>
</head>
<body onKeyPress="keys()">
</body>
</html>

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!