Solved

Word Values

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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
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…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

730 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