Question: complete this program. This program needs HTML tags. var gradeList = []; var nameList = []; var grade; var name= prompt(Enter a name: );//(1) while

complete this program.

This program needs HTML tags.

var gradeList = [];

var nameList = [];

var grade;

var name= prompt("Enter a name: ");//(1)

while (name != "???"){ //(2)

nameList.push(name);//(3)

grade = parseInt(prompt("Enter a grade: "));

gradeList.push(grade);

name= prompt("Enter a name: ");//(4)

}//end while

for (var i = 0; i < gradeList.length; i++) {

document.writeln(nameList[i], " ");

document.writeln(gradeList[i], " ");

} //for

Then explain the while statement. When will this while statement stop?

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!