Solved

Word Values

Posted on 2011-09-30
3
174 Views
Last Modified: 2012-05-12
Please list all 3,4, and 5 letter words whose word values are 30
0
Comment
Question by:isogram7
  • 2
3 Comments
 

Author Comment

by:isogram7
ID: 36890451
If a=1, b=2, c=3
0
 
LVL 11

Accepted Solution

by:
G_H earned 500 total points
ID: 36891113
Hi,

Enjoyed this...

 
Function WordValue(Input)
	WordTotal = 0
	Input = UCase(Input)
	for i = 1 to len(Input)
		Char = Mid(Input, i, 1)
		LetterValue = Asc(Char) - 64
		WordTotal = WordTotal + LetterValue
		response.write LetterValue & "<br/>"
	next

	WordValue = WordTotal
End Function



TestWord = "ff"

if len(TestWord) > 5 then
	response.write "WordTooLong"
elseif len(TestWord) < 3 then
	response.write "WordTooShort"
elseif WordValue(TestWord) = 30 then
	response.write "Success: " & TestWord & " works!"
else
	response.write "WordNot30"
end if

Open in new window


I think you may need to do more error checking for non-alpha's maybe...

GH
0
 

Author Closing Comment

by:isogram7
ID: 36972416
formula provided; expected list-not sure how to follow through. thank you anyway
0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I would like to start this tip/trick by saying Thank You, to all who said that this could not be done, as it forced me to make sure that it could be accomplished. :) To start, I want to make sure everyone understands the importance of utilizing p…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question