How do I get the program to end entering "q". Here's what I've done so far:
Code:
<script type = "text/javascript">
function assignFirstClass( first )
{
alert ( "You are assigned seat " + + " in first class" )
}
function assignCoach ( coach )
{
alert ( "You are assigned seat " + + " in first class" )
}
</script>
</head>
<body>
<script type = "text/javascript">
var firstclass = new Array ( 5 );
var coachclass = new Array ( 5 );
var question = "y";
while ( question.toLowerCase() == "y" )
{
question = prompt ( "Please Type\n'F' For First Class Ticket\n'C' For Coach Seating\n'V' For View Seating Chart\n'Q' For Quit Program" )
if ( question.toLowerCase() == "f" )
firstclass [ i ] = 1
assignFirstClass ( firstclass )
if ( question.toLowerCase() == "c" )
coachclass [ i ] = 1
assignCoach ( coachclass )
if ( question.toLowerCase() == "v" )
alert ( firstclass + coachclass )
question = prompt( "Please Type\n'F' For First Class Ticket\n'C' For Coach Seating\n'V' For View Seating Chart\n'Q' For Quit Program" );
}
</script>
Comment