Article View: aus.computers.java
Article #1074Help, newbie..question concerning character analysis of an input text string
From: Michael Little
Date: Mon, 23 Aug 1999 00:00
Date: Mon, 23 Aug 1999 00:00
44 lines
2213 bytes
2213 bytes
Hello, I was wondering if some-one could help me, I am trying to write a short program to get one sentence as a command line argument and it must return the following: 1. The number of blank characters in the entire sentence 2. The number of words in the entire sentence 3. The number of non-blank characters in the entire sentence 4. The average number of characters per word 5. The length of the longest word( in characters) 6. The length of the sentence( in words) 7. The number of capital and lowercase characters 8. The number of vowels and consonants. The input sentence can contain letters and digits, with one or more special characters separating each word in the sentence, and once entered the program should print the above values. Any suggests as how to best handle this problem? I am also not sure how to determine if a character is upper or lower case: do they belong to different character ranges? Any help appreciated! -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ MIchael John Little "Sine Timore,Per Ardua Ad Astra!" Hyper Communications "Knowledge is Power, yet True Power is Communicating Knowledge" 1/36 Lusher Road Croydon Victoria Australia Tel. (61) 0418 363 918(mobile) or (613) 9722 9167(home) ICQ#10658189 Email: hypercom@c031.aone.net.au WWW: http://www.ozemail.com.au/~hypercom ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Technical Details
Message-ID:
<qfbw3.7309$O_1.50063@ozemail.com.au>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 113ae9,49e42ebcf2e23fff,start X-Google-Attributes: gid113ae9,public X-Google-Thread: 10d6db,49e42ebcf2e23fff,start X-Google-Attributes: gid10d6db,public From: "Michael Little" <hypercom@c031.aone.net.au> Subject: Help, newbie..question concerning character analysis of an input text string Date: 1999/08/23 Message-ID: <qfbw3.7309$O_1.50063@ozemail.com.au> X-Deja-AN: 516143808 Distribution: world X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Trace: ozemail.com.au 935411798 203.108.204.229 (Mon, 23 Aug 1999 22:36:38 EST) Organization: OzEmail Ltd, Australia X-MSMail-Priority: Normal NNTP-Posting-Date: Mon, 23 Aug 1999 22:36:38 EST Newsgroups: aus.computers.java,comp.lang.java.help