Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 length and index help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
ZeroPaladn




PostPosted: Mon Oct 24, 2005 1:18 pm   Post subject: length and index help

im doing a program for school called the "word canibalizer". apparently its supped to take the raw components of a word and display them on the screen. for example...

input = 12er45yu
output
- 4 numbers
- 2 vowels
- 2 constanants
- 0 other
- 0 spaces

i do not have any clue on how either index or length work, or how they can be put together to make such a program. even after the teacher explained it to me countless times, im still lost. can any1 help me out here?
Sponsor
Sponsor
Sponsor
sponsor
TokenHerbz




PostPosted: Mon Oct 24, 2005 1:23 pm   Post subject: (No subject)

Try reading threw this tutorial, you may find it helpful.

http://www.compsci.ca/v2/viewtopic.php?t=8229
Cervantes




PostPosted: Mon Oct 24, 2005 6:27 pm   Post subject: (No subject)

Here's a hint:
code:

const numbers := "0123456789"

for i : 1 .. length (input)
    if index (numbers, input (i)) > 0 then
        num_of_numbers += 1
    end if
end for
ZeroPaladn




PostPosted: Tue Oct 25, 2005 9:21 am   Post subject: (No subject)

oh dear god i think i got it! thanks token and cervantes, that tuorial helped a bit, but i didnt quite understand it untill cervantes posted that code. i think ill be generous today.

+ 10 bits to token

cant donate to mods, sorry cervantes!
TokenHerbz




PostPosted: Tue Oct 25, 2005 2:29 pm   Post subject: (No subject)

THANKS!

I think thats the 1st time anyones donated to me Smile
Cervantes




PostPosted: Tue Oct 25, 2005 4:53 pm   Post subject: (No subject)

ZeroPaladn wrote:
cant donate to mods, sorry cervantes!

Technically you can. But my bits go back to 1000 when I make another post, so its wasted. It's the thought that counts, though! Smile

TokenHerbz wrote:
I think thats the 1st time anyones donated to me

Oh, I think I owed you approximately 15 bits for calling me canvas. Enjoy.
MysticVegeta




PostPosted: Wed Oct 26, 2005 1:52 pm   Post subject: (No subject)

oh yea i remember that! Canvas - and there were others too, i forgot, i think it was different everytime. By the ways: great tut by you on string manipulation, helped me a lot last year.
beard0




PostPosted: Wed Oct 26, 2005 2:45 pm   Post subject: (No subject)

What is it with people calling Cervantes Canvas? Can you people not read?
Sponsor
Sponsor
Sponsor
sponsor
codemage




PostPosted: Wed Oct 26, 2005 4:00 pm   Post subject: (No subject)

Take it easy there 0bread. Wink
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 9 Posts ]
Jump to:   


Style:  
Search: