![]() |
| ||||||||||
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Javascript Need help with the (primarily) client-side programming language? This is the place. Includes discussion on AJAX (Asynchronous JavaScript and XML). |
![]() |
| | LinkBack | Thread Tools | Display Modes |
| |||
| Okay so it is not looking how I want it, and I know i am only missing a few things, maybe very minor. But I want the program to first prompt 'How many numbers...' and then ask 'What is the 1st number?' etc etc and then calculate the sum and average, and ask if you want to re-do or not. If you launch this code, a few of the prompts are there but its not connecting. Thanks in advance! <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Conditionals</title> <script type="text/javascript"> //<![CDATA[ function runJS() { var sum = 0; var average = 0; var count = parseFloat(prompt("How many numbers do you want to sum up?", "3")); average = sum/3; alert("The average is: " + average + ".\nThe sum is: " + sum + "."); } //]]> more = prompt("Would you like to do another calculation? (Y/N)", "Y"); </script> </head> <body onload="runJS();"> </body> |
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| 10 free points! Positive Points of a Mobile Phones. | Crystal Unicorn | General - Education & Reference | 0 | 08-04-2008 06:09 PM |
| Visual Basic | naives | Programming / Scripting / Coding Forum | 7 | 02-02-2008 09:19 PM |
| Windows Vista Basic | BOoBOo | Windows Vista | 0 | 04-05-2007 02:58 AM |
| Some basic questions... | wsc | Web Hosting Support | 1 | 09-02-2006 07:23 PM |
| basic html help | Pelle | Programming / Scripting / Coding Forum | 25 | 08-09-2003 06:35 PM |