Solved

Word Values

Posted on 2011-09-30
3
170 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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I was asked about the differences between classic ASP and ASP.NET, so let me put them down here, for reference: Let's make the introductions... Classic ASP was launched by Microsoft in 1998 and dynamically generate web pages upon user interact…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

705 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now