Archived

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

Javascript Calculator Program

This topic is 5585 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
Use onclick messages. I wrote a small java-script game called Boat (not my idea, it was part of a very large joke project) that had a few buttons that had the onclick attribute set to one of my game functions.

You can see it here.



The hackers must have gotten into the system through the hyperlink!!

Invader''s Realm

Share this post


Link to post
Share on other sites
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