How do i write a javascript program that asks the user to enter up to 10 golf scores, which are to be stored in an array? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How do i write a javascript program that asks the user to enter up to 10 golf scores, which are to be stored in an array?

You should provide a means for the user to terminate input prior to entering 10 scores. The program should display all the scores on one line and report the average score. Handle input, display, and the average calculation with three separate array processing functions.

16th Sep 2018, 8:55 AM
Eustice Kabelo Thuke
Eustice Kabelo Thuke - avatar
4 Answers
+ 1
The instructions are so clear, I guess this is a homework? : )
16th Sep 2018, 9:38 AM
Ipang
+ 1
yeah😅
16th Sep 2018, 9:46 AM
Eustice Kabelo Thuke
Eustice Kabelo Thuke - avatar
+ 1
Then I'm gonna give you some hints to get started with, you need to give it a try first, then come back when you have a code in progress, I doubt people here will do it for you, but they will help you to get your work complete, seeing you had given an effort : ) * Create the function where you use a loop to get the 10 scores inputs, saving the input into an array. * Create the function to display the scores on the page. For this you can use table. * Create the function to calculate the average with, it's quite simple, just sum the 10 scores to a variable, then divide it by 10, there you have it. Best of luck with the code : )
16th Sep 2018, 9:56 AM
Ipang
0
thanks man...
16th Sep 2018, 10:00 AM
Eustice Kabelo Thuke
Eustice Kabelo Thuke - avatar