![]() |
| ||
| confused hi i am writing a program that counts words containing at least 3 different vowels using functions and also input files.i am confused here and don't know what to do.in this program i am to write another function that will output either 1 or 0 when a character is a vowel or not.please help me . this is where i've gotten so far #include<iostream> |
| ||
| Re: confused Will the file be one word per line or do you have to parse the line into individual words. Once you have a single word I'd send it to vowel(). I don't know why you would want to send three strings to vowel(). You don't really need the string word in vowel(). I'd initialize count to zero before I tried to use it. I'd create a string containing all the vowels I'm looking for. Then I'd use a nest loop to compare each letter of the word passed to vowel with each letter in the string of vowels. PS: Please use code tags when posting code to this board. |
| ||
| Re: confused i'm supposed to test for three sentences. |
| ||
| Re: confused So is the file like this: tweedle dee Humpty dumpty Trouble with programming or like this: tweedle dee humpty dumpty Trouble with programming |
| ||
| Re: confused You need to put a return after line 18 is executed because there is no point contuining that function if it fails to open the file. |
| ||
| Re: confused I have just read the whole thing and I am confused as to what do you have to do here. And I am getting sys. reqs from some crazy manages for a living. So you got to count unique vowels? Can we get an example of the text file? Ancient Dragon is right, got to exit if file is not opened properly, I guess you guys did not study exceptions yet, simple return would do. Keep in mind, your L1, L2 and L3 are not innitialized and are passed into a your mistery function, that is no good. While not clearly understanding what do you have to do here, here is my suggestion on how to make at least what you wrote workable: int main(){ |
| All times are GMT -4. The time now is 8:29 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC