lab17js
This commit is contained in:
		
							
								
								
									
										18
									
								
								Chapter ZIPs/JavaScript/ch8/ex_8_7.html
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										18
									
								
								Chapter ZIPs/JavaScript/ch8/ex_8_7.html
									
									
									
									
									
										Executable file
									
								
							@@ -0,0 +1,18 @@
 | 
			
		||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 | 
			
		||||
<html>
 | 
			
		||||
<head>
 | 
			
		||||
	<title>Example 8.7</title>
 | 
			
		||||
	<script type="text/javascript">
 | 
			
		||||
var names = new Array();
 | 
			
		||||
var numStud = prompt("How many students are in the class? ");
 | 
			
		||||
numStud = parseInt(numStud);
 | 
			
		||||
var i = 0;
 | 
			
		||||
for (i = 0; i <= numStud - 1; i++)
 | 
			
		||||
{
 | 
			
		||||
	names[i]= prompt("Enter the student's name: ");
 | 
			
		||||
	document.write("Name of student " + (i + 1) + ": " + names[i] + "<br />");
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
</head>
 | 
			
		||||
<body>
 | 
			
		||||
</body></html>
 | 
			
		||||
		Reference in New Issue
	
	Block a user