Try this
And what grade doyou expect to get for doing sodha125's homework for him? Around here we call that cheating... Good job!
WaltP
Posting Sage w/ dash of thyme
10,505 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
WaltP's response seems a bit harsh to me. The program posted does indeed demonstrate one way to accept input (though it doesn't look like it will appease the instructor given the comment in the instructions that the ASCII value for return key is 13, implying that input should accept all valid key input, including whitespace), and it does demonstrate one way to tell if a char is a vowel, but it doesn't demonstrate how to store information about individual vowels or how to analyze the information as requested in the instructions provided. All in all if the program as posted were presented as final project I would give it a D at best, given the mere basics it demonstrates. All in all, I would have been more comfortable if sodha125 had posted cangan's program, but as a place to start from, I found cangan's program reasonable. On the other hand I'm not a moderator nor do I have the experience WaltP does; I am just expressing my opinion as well as to express my hope that cangan doesn't feel too castigated.
Lerner
Nearly a Posting Maven
2,382 posts since Jul 2005
Reputation Points: 739
Solved Threads: 396
The posted program doesn't solve the original question, all it does is demonstrate one way to identify vowels. The OP would have to add quite a bit of code in order to complete the assignment.
Ancient Dragon
Retired & Loving It
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
My point is we do not condone posting working programs as a starting point for a poster. We help him write his own code. The program does a large chunk of what the OP needed -- enough that the homework would not be his.
If cangan had posted psuedo-code, I would have no problem with the post.
My comment stands.
WaltP
Posting Sage w/ dash of thyme
10,505 posts since May 2006
Reputation Points: 3,348
Solved Threads: 944
>>sodha125---The best way to start a project is to take a piece of paper and pencil (pen if you're bold) and write out what to do before ever setting down in front of the keyboard. For example you could start by rewriting the information in your post like this:
1) Obtain input:
From where?
Without or without whitespace?
2) Evaluate input char by char
is it a vowel
if so, increment a counter for the appropriate vowel
3) determine which vowel occurs most often in the collection of vowels
4) determine average (mean) occurence for the vowels in the collection of vowels:
eg a = 3, e = 9, i = 6 would yield average of 6
5) display vowels in the collection in ascending order by frequency in a table listing vowel and fequencey of occurence for each vowel
Then expand each step, answering questions you initially wrote at each step, looking up techniques to accomplish a given task if needed (ask a specific question with pertinent code at a place like Daniweb if you can't find answers elsewhere) and adjusting the written language to look more like code with each iteration through the steps until you get pseudocode and then, and only then, try to write actual code. As you write the code don't write more than one step (or one part of a step) without recompiling. When you get as good as WaltP or Ancient Dragon, then you can hedge on these steps, but the basic process will remain the same, it's just that you do it in your head rather than with paper and pencil----though I suspect there is a ready supply of paper and pencil in their workspace if we had the oppotunity to look.
>>cangan---I agree with WaltP. It is not appropriate to help too much with homework. The only reason I came down on your side is that I too struggle with how much is too much help and I didn't want you to feel too intimidated. I've had the same criticisms leveled at me, correctly so, in the past. We learn as we go.
>> WaltP---I understand and respect your position. My only disagreement is with how much help is too much help.
Lerner
Nearly a Posting Maven
2,382 posts since Jul 2005
Reputation Points: 739
Solved Threads: 396