:: Your Computer Technical Resource Headquarters! :: Your Computer Technical Resource Headquarters!
Computer Support Forums arrow Software Support arrow Programming Problems arrow Topic: javacsript
July 04, 2020, 06:26:02 PM

Home Forum Rules Help Search Mobile Version Login Register

Welcome, Guest. Please login or register.
Did you miss your activation email?
July 04, 2020, 06:26:02 PM

Login with username, password and session length
 Featured Sites:
New  We now offer Merchandise! Every purchase goes towards maintaining our site.
Thank you for supporting!
  0 Members and 1 Guest are viewing this topic.
Pages: [1] Go Down Print
Author Topic: javacsript  (Read 1784 times)
Jr. Member

Karma: +0/-0
Offline Offline

Gender: Male
Posts: 12

Bookmark and Share

View Profile
« on: May 17, 2005, 04:37:05 PM »

am new to JavaScript and would appreciate a little help.
I have a small program to count the number of times a letter a is input. it finishes when a z is input and displays the total number of a's at the end.

This is the code i have and i am sure i am missing something very simple but cannot see it. many thanks.



var letter, total;
total = 0;

letter = window.prompt('Please enter a letter, z to
stop', '');

while (letter != 'z')

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)





Karma: +0/-0
Offline Offline

Posts: 7

Bookmark and Share

View Profile
« Reply #1 on: May 26, 2005, 03:46:20 PM »

What is it not doing correctly?

Pages: [1] Go Up Print 
Jump to:  

Powered by MySQL Powered by PHP

Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS!

This site is NOT responsible for any damage that the information on this site may cause to your system. Everything you try, whether inspired by the response given from this site or not, is entirely at your own risk. All product names and company names used herein are for identification purpose only and may be trademarks or registered trademarks of their respective owners. We are in no way affiliated or representing any of the companies on this site unless specified.
Back to Top
Stop Spam Harvesters, Join Project Honey Pot Fight Back Against Spammers! Get Firefox! Get Thunderbird! View Sylvain Amyots profile on LinkedIn
Back to Top
Google visited last this page September 24, 2018, 06:10:47 AM