Computer Science Canada program to find vowels and get rid of them |
Author: | fkid [ Tue Apr 13, 2004 4:44 pm ] |
Post subject: | program to find vowels and get rid of them |
Ok... Basically I want to find a way to receive a word from a user, then find the vowels and afterwards, spell out the same word but without the vowels this time. This is what I have so far.... ------------------------------------------------------------------------------------- var word : string var vowel : array 1 .. 10 of char vowel (1) := 'a' vowel (2) := 'e' vowel (3) := 'i' vowel (4) := 'o' vowel (5) := 'u' vowel (6) := 'A' vowel (7) := 'E' vowel (8 ) := 'I' vowel (9) := 'O' vowel (10) := 'U' put "Please enter any one word for me to spell out without any vowels: " .. get word for i : 1 .. length (word) for ii : 1 .. 10 if word (i) = vowel (ii) then % put "" for the vowel how? end if end for end for put word % now how can i put the word without the vowels now?? ------------------------------------------------------------------------------------- Right now when I run the program, I get asked to input a word right. Then when I press Enter it just repeats the word. The problem is I want the program to repeat it but without the consonants so basically replace the vowels in the word with "". The comments show my main problems I guess.. Thanks for your time and help in advance! Note: written in v.4.0.5 |
Author: | AsianSensation [ Tue Apr 13, 2004 5:52 pm ] |
Post subject: | |
http://www.compsci.ca/v2/viewtopic.php?t=4040&highlight=vowel search button. |
Author: | EDEN-E [ Tue Apr 13, 2004 8:31 pm ] | ||
Post subject: | Re: program to find vowels and get rid of them | ||
|
Author: | nate [ Tue Apr 13, 2004 9:25 pm ] | ||
Post subject: | |||
God, just use the index function it makes life muh easier!! Well, here u go some free code |
Author: | Paul [ Tue Apr 13, 2004 9:39 pm ] |
Post subject: | |
or you could just NOT post this, and have them find it using "search", this question or variations of this have been asked many times. Using search, you could have found these easily http://www.compsci.ca/v2/viewtopic.php?t=4040&highlight=vowels http://www.compsci.ca/v2/viewtopic.php?t=3631&highlight=vowels http://www.compsci.ca/v2/viewtopic.php?t=2558&highlight=vowels http://www.compsci.ca/v2/viewtopic.php?t=3753 http://www.compsci.ca/v2/viewtopic.php?t=440 they all help you find vowels or patterns in a string, once knowing how to do that, removing them is easy. |
Author: | fkid [ Wed Apr 14, 2004 11:01 am ] |
Post subject: | |
Thanks soo much.... Never knew about the index command.. Now I know.. THANK YOU!! |