This preview shows pages 1–4. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: and the total of numbers entered. At the end output the total, count and average. Assume the user will enter at least one number. (Exam question will be more difficult than this, study javascript 2 and 3 assignments) 1. Start 2. Create variables usernumber, count, total, average,userconfirm 3. Set count equal to 0, total equal to 0 4. Ask user for usernumber 5. Add usernumber to total 6. Add 1 to count 7. Ask user for userconfirm 8. If userconfirm is true go to step 4 9. Set average = total/count 10. Output total, count, average 11. End <html> <head><title>My awesome answers</title></head> <body> <script type=text/javascript> var usernumber,total=0,count=0,userconfirm,average; do { usernumber =1*prompt(enter number,); total+=usernumber; count++; userconfirm=confirm(continue?); } while (userconfirm==true) document.write(total is + total + average is + average+ count is + count); </script> </body> </html>...
View Full
Document
 Fall '08
 GayatreeGanu

Click to edit the document details