help!.......

please help me make word count program using java

Page 1 of 1

3 Replies - 1229 Views - Last Post: 15 October 2007 - 08:38 AM Rate Topic: -----

#1 kuyagen17  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 14-October 07

help!.......

Post icon  Posted 14 October 2007 - 01:14 AM

plz!.......
Is This A Good Question/Topic? 0
  • +

Replies To: help!.......

#2 dreadcode  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 18-September 07

Re: help!.......

Posted 14 October 2007 - 02:11 AM

words that are separated by spaces? try StringTokenizer

st = new StringTokenizer (myString, " ");
int numWords = st.countTokens();

Was This Post Helpful? 0
  • +
  • -

#3 UltraFlynn  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 2
  • View blog
  • Posts: 136
  • Joined: 03-August 07

Re: help!.......

Posted 14 October 2007 - 02:35 AM

View Postkuyagen17, on 14 Oct, 2007 - 09:14 AM, said:

plz!.......


You need to have a go at coding this yourself and post up where you have issues.
Was This Post Helpful? 0
  • +
  • -

#4 allican57  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 38
  • Joined: 02-October 06

Re: help!.......

Posted 15 October 2007 - 08:38 AM

View PostFlynn, on 14 Oct, 2007 - 02:35 AM, said:

View Postkuyagen17, on 14 Oct, 2007 - 09:14 AM, said:

plz!.......


You need to have a go at coding this yourself and post up where you have issues.

I hope this will help, but please try a little harder. You will not learn this way!


*Word Counter
Write a method that accepts a String object as an argument and returns the number of words it contains.
For instance, if the argument is “Four score and seven years ago” the method should return the number 6.
Demonstrate the method in a program that asks the user to input a string and then passes it to the method.
The number of words in the string should be displayed on the screen.



MOD EDIT: ** Content removed...topic starter must show an effort before answers will be provided **
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1