----------------------------------- fkid Tue Apr 13, 2004 4:44 pm 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 ----------------------------------- AsianSensation Tue Apr 13, 2004 5:52 pm ----------------------------------- http://www.compsci.ca/v2/viewtopic.php?t=4040&highlight=vowel search button. ----------------------------------- EDEN-E Tue Apr 13, 2004 8:31 pm Re: program to find vowels and get rid of them ----------------------------------- var word : string var vowel : array 1 .. 10 of char := init ('a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U') % you can give values to array variable using init(initialization) var isvowel : boolean % boolean type can have only true or false. put "Please enter any one word for me to spell out without any vowels: " .. get word for i : 1 .. length (word) isvowel := false % set isvowel = false for j : 1 .. 10 if word (i) = vowel (j) then % if word(i) is a vowel isvowel := true % iswovel becomes true end if end for if isvowel = false then % if isvowel is false(isnot true), which means word(i) isnt vowel put word (i) .. end if end for ----------------------------------- nate Tue Apr 13, 2004 9:25 pm ----------------------------------- var vowels : string := "aeiouAEIOU" var word : string put "Please enter any one word for me to spell out without any vowels:" .. get word for i : 1 .. length (word) if index (vowels, word (i))