I AM TRYING FIGURE OUT A PROGRAM THAT COUNT THE NUMBER OF PEOPLE WHO GET OFF A TRAIN EACH TIME IT STOPS AT A SPECIFIC LOCATION
THIS IS MY CODE:
<html><head><title>Javascript</title></head>
<body>
<h1>Javascript example 1</h1>
<script language="JavaScript">
var count = 0;
var max = 0;
var min = 0;
var total = 0;
var avg = 0;
var passengers = 0;
var continue = true;
continue == confirm("Do you want to play?");
if(continue==true)
{
alert("lets play");
}
else
}
alert("see ya, peace out!");
}
while(continue==true)
{
passengers = parseInt(prompt("how many people got off the train?"));
count++;
if(count == 1)
{
max = passengers;
min = passengers;
}
if(max < passengers)
{
max = passengers;
}
if(min > passengers)
{
min = card;
}
total = total + passengers;
continue=confirm("play again?");
}
if(continue == true)
{
alert(“get continue”);
}
else
{
total = total / avg;
}
document.write(max, min, total, avg, count);
</script>
<p>Regular page content</p>
</body>
</html>