0
HELP PLIS
It is an exercise given by my teacher and I really don't know how to do it. We have to use the for loop and do it in JavaScript. I appreciate any help you can offer me. ♡. Write a program that allows entering 10 numbers and obtain the following results. Note: You should not use 10 different variables; you can reuse the same variable. - The total sum of all entered numbers - The average of all entered numbers
2 Antworten
+ 6
make a variable to store the sum, initialize it with 0.
make a for-loop that iterates 10 times.
on each iteration, get input.
convert each input to a number and add it to the sum-variable.
the average is the sum divided by 10.
+ 5
Lisa you're the best, I over looked the important part it requires input. Good catch!