counting letters java

Oct 19th, 2014
DreamIt
Category:
Programming
Price: $40 USD

Question description

6-20) (Count the letters in a string ) Write a method  that counts the number of letters in astring  using the following header:

public static int  countLetters(String  s)
Write a test program  that prompts the user to enter a string  and displays the number of letters in the string , not counting numbers, spaces, or symbols. 


SAMPLE RUN #1

--- Prompts For Keyboard/Console/Standard Input ---

Enter a string  of letter, numbers, spaces, and symbols:

Inputs

--- Keyboard/Console/Standard Input stdin ---

Jogging 10,000 miles is probably not good. 

Outputs 

--- Monitor/Console/Standard Output  ---

Enter a string  of letter, numbers, spaces, and symbols:The number of letters in the string  is: 29

What The Console Looks Like In An Interactive Session:

(Note: this combines standard input with standard output )

>java LetterCount 
Enter a string  of letter, numbers, spaces, and symbols: Jogging 10,000 miles is probably not good. 
The number of letters in the string  is: 29

SAMPLE RUN #2

--- Prompts For Keyboard/Console/Standard Input ---

Enter a string  of letter, numbers, spaces, and symbols:

Inputs

--- Keyboard/Console/Standard Input stdin ---

When C02 builds up the TEMP goes up! 

Outputs 

--- Monitor/Console/Standard Output  ---

Enter a string  of letter, numbers, spaces, and symbols:The number of letters in the string  is: 26

What The Console Looks Like In An Interactive Session:

(Note: this combines standard input with standard output )

>java LetterCount 
Enter a string  of letter, numbers, spaces, and symbols: When C02 builds up the TEMP goes up! 
The number of letters in the string  is: 26

SAMPLE RUN #3

--- Prompts For Keyboard/Console/Standard Input ---

Enter a string  of letter, numbers, spaces, and symbols:

Inputs

--- Keyboard/Console/Standard Input stdin ---

500 miles is a popular walking metric for love songs, or so they say. 

Outputs 

--- Monitor/Console/Standard Output  ---

Enter a string  of letter, numbers, spaces, and symbols:The number of letters in the string  is: 51

What The Console Looks Like In An Interactive Session:

(Note: this combines standard input with standard output )

>java LetterCount 
Enter a string  of letter, numbers, spaces, and symbols: 500 miles is a popular walking metric for love songs, or so they say. 
The number of letters in the string  is: 51

SAMPLE RUN #4

--- Prompts For Keyboard/Console/Standard Input ---

Enter a string  of letter, numbers, spaces, and symbols:

Inputs

--- Keyboard/Console/Standard Input stdin ---

CAPS lowercase both count !@#$%^&*( 1234567890 should not. 

Outputs 

--- Monitor/Console/Standard Output  ---

Enter a string  of letter, numbers, spaces, and symbols:The number of letters in the string  is: 31

What The Console Looks Like In An Interactive Session:

(Note: this combines standard input with standard output )

>java LetterCount 
Enter a string  of letter, numbers, spaces, and symbols: CAPS lowercase both count !@#$%^&*( 1234567890 should not. 
The number of letters in the string  is: 31

compile with NetBeans

Tutor Answer

(Top Tutor) Daniel C.
(997)
School: UT Austin
PREMIUM TUTOR

Studypool has helped 1,244,100 students

5 Reviews


Summary
Quality
Communication
On Time
Value
ashleyisgod
Nov 29th, 2016
" Top quality work from this guy! I'll be back! "
Molly_Moon
Nov 6th, 2016
" AMAZING as always! "
Hemapathy
Oct 15th, 2016
" all I can say is wow very fast work, great work thanks "
BlueOcean
Oct 1st, 2016
" Awesome! Exactly what I wanted. "
kevin12622
Sep 22nd, 2016
" Goes above and beyond expectations ! "
Ask your homework questions. Receive quality answers!

Type your question here (or upload an image)

1824 tutors are online

Brown University





1271 Tutors

California Institute of Technology




2131 Tutors

Carnegie Mellon University




982 Tutors

Columbia University





1256 Tutors

Dartmouth University





2113 Tutors

Emory University





2279 Tutors

Harvard University





599 Tutors

Massachusetts Institute of Technology



2319 Tutors

New York University





1645 Tutors

Notre Dam University





1911 Tutors

Oklahoma University





2122 Tutors

Pennsylvania State University





932 Tutors

Princeton University





1211 Tutors

Stanford University





983 Tutors

University of California





1282 Tutors

Oxford University





123 Tutors

Yale University





2325 Tutors