?
Solved

Word Values

Posted on 2011-09-30
3
Medium Priority
?
178 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 1500 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

764 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