katiet
Newbie
Posts: 1
Registered: 4/6/2005
Location: uk
Member Is Offline
|
| posted on 4/6/2005 at 03:47 PM |
|
|
INPUT SEQUENCES PLS HELP
Hi anyone, I have tired adn tried to solve this but I cant, i keep getting an error..can anyone help me pls...
I need to oinput sequences of alpha char. alwasy ending with z i want the program to output the number of times the character a was include din the
input sequence and i caem up with
var letter, total;
letter = window.prompt('Please enter a letter, z to stop', '');
while (letter != 'z')
{
total = 0;
if letter ='a'
{
total = total + 1
}
letter = window.prompt('Please enter a letter, z to stop', '')
}
document.write('The number of 'a's you have input is ' + total)
</SCRIPT>
</HEAD>
but its not working.. i cant see why.. someone help please t hank you
|
|
|
|