javascript – I have to do the following exercise:

statement: It is intended to develop a program that does the following:
1. Ask to read a certain number N of whole numbers or not and positive or not, from the keyboard;
2. These N numbers will be introduced, and then the program should present a list with the following classifications on the screen:
– section of the read integers
– number of fractionaries read
– No. of negative sections read
– No. of positive sections read
– sum of the negative numbers read
– sum of the positive numbers read
– average of the negative numbers read
– average of positive numbers read
– sum of all the sections read
– average of all the sections read

what I managed to do: var n, sum, average, listing;

                                n = Number (indicator ("What is the number of numbers you want to enter?"));

= "Calculate the average of the numbers";
listing + = calMedia (n);
alert (list);

function calMedia (num) {
sum = 0;
(var i = 1; i <= num; i ++) {} ()
sum + = Number (symbol (i + "ยบ number?"));
}
mean = sum / num;

Listing + = " nNes read:" + num;
listing + = " nSome of the numbers read:" + sum;
list + = " nMedia of the sections read:" + media;
return the list;
}