Purchase Solution

Methods, Constructors, Loops and Arrays Demonstrated in Java

Not what you're looking for?

Ask Custom Question

Write an interactive Java program that illustrates the use of methods, constructors, loops and arrays. Your Program will do the following:

1. Ask the user for a String input of letters, i.e., Ohio; John Doe; AnyTown. Notice that strings with spaces are allowed.
2. Offer your user two choices:
1. Determine the length of the string
2. Determine how many consonants and how many vowels are in the word.
3. You must write your own method to determine the length of the String (do not use String's length() method).
4. You must error check your users' input for numbers and special characters.
5. You must give your user three opportunities for wrong input before you terminate the program.
6. In the absence of three consecutive erroneous input attempts, your user must have the opportunity to continue running the program until directly deciding to terminate.

Purchase this Solution

Solution Summary

Solution attaches a program that reads in a string and returns either its length or the number of consonants and vowels in it, complete with error checking, in order to demonstrate essential code skills in Java.

Purchase this Solution


Free BrainMass Quizzes
Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

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.

Basic Networking Questions

This quiz consists of some basic networking questions.

Excel Introductory Quiz

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

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.