954,536 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Can someone give me a code for this?

a JAVA program that would input a string and display the total number of vowels and total number of consonants. (use method)
Example:
Input a string: beautiful
Total Vowels: 5
Total Consonants: 4

loozax
Newbie Poster
15 posts since Jul 2009
Reputation Points: 10
Solved Threads: 0
 

try for your self.
if you face problem while trying post here.

DangerDev
Posting Pro in Training
485 posts since Jan 2008
Reputation Points: 165
Solved Threads: 59
 
Can someone give me a code for this? ...


Yes. I won't though. Read the terms and conditions of this site, again, please. Youhave read them at least once, already, right?

masijade
Industrious Poster
Moderator
4,253 posts since Feb 2006
Reputation Points: 1,471
Solved Threads: 494
 
System.out.println("I am not putting any effort to code my homework");
ithelp
Nearly a Posting Maven
Banned
2,230 posts since May 2006
Reputation Points: 769
Solved Threads: 128
 

Guys, please drop this mocking it doesn't help any of us.

@loozax you should be aware that there is a rule on this forum which says " We only give homework help to those who show effort ". So presuming that you still on this task I would recommend you do some coding, post code and ask questions related to code or specific issue and not general request to do your homework

peter_budo
Code tags enforcer
Moderator
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
 

Oh, I had to do this one too!

I suggest you start by putting everything you can down in code and then when/if you get stuck the post what you have and we can help you through it. The toughest part is getting yourself started.

rapture
Posting Whiz in Training
294 posts since Jul 2007
Reputation Points: 155
Solved Threads: 41
 

Identify what the program needs to do very specifically.
Prompt the user to input a String
Separate the String into separate characters
Identify the case of each letter
Tally up the number of each type of character
Ignore the characters that aren't letters
Display the final tally

Briefly list out ways in which you could do each component and then you'll have a much better idea of how to string everything together with code.

To start you off:
Everything you need should be on these two pages:
http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Character.html
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html

Good luck.

Godstryke
Newbie Poster
24 posts since Jul 2009
Reputation Points: 66
Solved Threads: 2
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You