counting letters java

counting letters java

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

"You need a similar assignment done from scratch? Our qualified writers will help you with a guaranteed AI-free & plagiarism-free A+ quality paper, Confidentiality, Timely delivery & Livechat/phone Support.


Discount Code: CIPD30



Click ORDER NOW..

order custom paper