Purchase Solution

Using String Methods to Count Characters

Not what you're looking for?

Ask Custom Question

****This needs to be written in Java*****

Generally, word processing programs can count and then display the number of characters in a document, either including or excluding blank characters. Using methods from the String class, write a program that will accept input from the keyboard and then display three values:

1) The count of all characters in the string, including leading and trailing blanks.

2) The count of characters not including leading and trailing blanks.

3) The count of all non-blank characters.

The program should continue as long as the user enters any values, even if only spaces are entered. Figure 9-49 (attached to post) displays sample output from the program.

****This needs to be written in Java*****

Attachments
Purchase this Solution

Solution Summary

Generally, word processing programs can count and then display the number of characters in a document, either including or excluding blank characters. Using methods from the String class, write a program that will accept input from the keyboard and then display three values.

Purchase this Solution


Free BrainMass Quizzes
C++ Operators

This quiz tests a student's knowledge about C++ operators.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

Inserting and deleting in a linked list

This quiz tests your understanding of how to insert and delete elements in a linked list. Understanding of the use of linked lists, and the related performance aspects, is an important fundamental skill of computer science data structures.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.