/    Sign up×
Community /Pin to ProfileBookmark

Beginner trying to make an Avg Calculator…Help

I am trying to write a JavaScript program in the body of the page that repeatedly prompts the user to enter a “Test Score” between 0-100. Then when the user clicks cancel the program displays the average in an alert box?

Can anyone help???
thanks,
Danny

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@KravvitzOct 31.2005 — Sounds like you want to use while(), prompt(), alert() and an array.
Copy linkTweet thisAlerts:
@pavelkodauthorOct 31.2005 — yes i know how to add the num up but how do i know what to divide them since i dont know how many numbers there are becasseu its up to the user
Copy linkTweet thisAlerts:
@KravvitzOct 31.2005 — Each time the user enters a number, assign it to a new node in the array. When the user clicks cancel, there won't be a number, so you should add all of the numbers in the array together and then divide them by the length property of the array.
Copy linkTweet thisAlerts:
@pavelkodauthorOct 31.2005 — got it ?
×

Success!

Help @pavelkod spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...