Creating a basic School GPA calculator using Array on JS console

I'm recently learning the usage of Array in JavaScript. So I am trying to create a school GPA calculator on JavaScript Console. Here is a piece of code I was trying... var num = prompt("enter a num") var numm= parseInt(num); var menu=new Array() for (i=0; i<=numm; i++){ menu[i] = prompt("enter your name") } How do I code it so that the program will auto sum all the input entered. Pls help

1/3/2020 5:53:55 AM


2 Answers

New Answer


I really don't understand what there is to sum! your code prompts for names, which presumably are not numbers. What exactly did you mean by this code?


How can I create a simple calculator that sums up all the numbers based on the input entered on the prompt box. I strongly needs array function to write this code