The Artima Developer Community
Sponsored Link

Java Answers Forum
Sentence HELP

3 replies on 1 page. Most recent reply: Sep 11, 2003 4:32 PM by Senthoorkumaran Punniamoorthy

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 3 replies on 1 page
Cory

Posts: 1
Nickname: crazy
Registered: Sep, 2003

Sentence HELP Posted: Sep 11, 2003 5:02 AM
Reply to this message Reply
Advertisement
You are going to write a program that will
Ask the user to enter a string. You will then go through the string and count how many occurrences of each of the following:
Letters
Vowels
Consonants
Digits
Spaces
Other
Total Length

Output should looks something like the following:

The phrase “Yes! It’s my birthday, I am 18 now. I can vote!”
Contains 30 letters, 11 of which are vowels and 19 consonants.
There are 2 digits, 11 spaces and 5 others. The total length of the string is 48 characters.

Notice All sentences start with capitals and end with punctuation. The quote is printed out with surrounded by the “”. To do this you would do something like this…
System.out.println( “\”” + quote + “\””);
Assuming quote is a string that contains the user entered quote.

Remember to INDENT properly, COMMENT your code and use DESCRIPTIVE variable names.
Before you begin typing your code you must turn in to me a pseudocode solution for your program.
An example of what part of your pseudocode might look like:
Run a loop that will examine each character in the user entered quote.
If the current character is a letter increment the letter counter by 1
Then test if the letter is a vowel, if it is increment the vowel counter by 1, otherwise increment the consonant counter by 1.

If the character isn’t a letter then test if it is a digit.
If it is a digit then increment………

Email Me At:

CrazyNKirby@hotmail.com


David

Posts: 150
Nickname: archangel
Registered: Jul, 2003

Re: Sentence HELP Posted: Sep 11, 2003 7:19 AM
Reply to this message Reply
Do your own coursework you lazy, lazy boy.

We're more than happy to *help you with* (note - this is not the same as *do for you*) your coursework if you ask questions about what you don't know how to do.

The coursework looks pretty straight-forward. What's the problem?

mausam

Posts: 243
Nickname: mausam
Registered: Sep, 2003

Re: Sentence HELP Posted: Sep 11, 2003 8:54 AM
Reply to this message Reply
Give me the mail id of ur instructor....it will be a nice idea talking her/him ..... ;-)

Senthoorkumaran Punniamoorthy

Posts: 335
Nickname: senthoor
Registered: Mar, 2002

Re: Sentence HELP Posted: Sep 11, 2003 4:32 PM
Reply to this message Reply
How many more forums you posted the same question :-)

Flat View: This topic has 3 replies on 1 page
Topic: Test a new site with psychedelic applets! Previous Topic   Next Topic Topic: Clearing input after readChar()

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use