Program that counts the number of occurrences of lowercase

Assignment Help JAVA Programming
Reference no: EM13163383

Write a program that counts the number of occurrences of lowercase and uppercase vowels in entered lines of text. Use a two-dimensional array to store the vowel counts. The array's first column holds the counts for the lowercase vowels, and the second column holds the counts for the uppercase vowels.

The user indicates the end of the input by pressing enter by itself. At that point, your program should print, for each vowel, the total number of lowercase occurrences, the total number of uppercase occurrences, and the total number of combined occurrences.

Here are some implementation requirements:

  • Use two separate files - one for a main driver method and one for a VowelCounter class that keeps track of vowel counts.
  • main - Repeatedly prompt the user to enter a line of text or press enter by itself to quit. Note that the stdIn.nextLine() method returns the empty string ("") if the user presses enter by itself. For each entered line of text, call the processLine method. When the user chooses to quit, call printSummary.
  • Within the VowelCounter class, include these methods:
    • processLine ? This method receives a line of text as a parameter and uses it to update the vowel counts appropriately.
    • printSummary ? This method prints a summary of the counts for all vowels entered.

Sample session:

Enter a line of characters (press enter by itself to quit):
Oscar the ostrich graduated
Enter a line of characters (press enter by itself to quit):
from Exeter in England.
Enter a line of characters (press enter by itself to quit):
 
A: 4 lowercase, 0 uppercase, 4 total
E: 4 lowercase, 2 uppercase, 6 total
I: 2 lowercase, 0 uppercase, 2 total
O: 2 lowercase, 1 uppercase, 3 total
U: 1 lowercase, 0 uppercase, 1 total

 

 

Reference no: EM13163383

Questions Cloud

A photo-sharing startup offers : A photo-sharing startup offers the following service. A client may upload any number N of photos and the server will compare each of the N pairs of photos with their proprietary image matching algorithms to see if there is any person that is in both ..
State a growth factor for cells : A growth factor for cells was identified from extracts of rat brain. Preliminary characterization was done on this activity using several methods.
How many grams of ch3oh must be added : How many grams of CH3OH must be added to water to prepare 150 mL of a solution that is 2.0 M CH3OH?
Revaluation and de-recognition of depreciable assets : Prepare journal entries to record the revaluation on 1 July 2013 and the subsequent sale on 1 July 2014 and revaluation and de-recognition of depreciable assets
Program that counts the number of occurrences of lowercase : Write a program that counts the number of occurrences of lowercase and uppercase vowels in entered lines of text. Use a two-dimensional array to store the vowel counts. The array's first column holds the counts for the lowercase vowels, and the secon..
Random string of 100,000 characters is written : A random string of 100,000 characters is written down, where each character is independently, equally likely to be any of the upper-case letters A through Z in English.
Determine the mass of aluminum acetate : Determine the mass of aluminum acetate that can be made if you do the reaction with 125 grams of acetic acid and 275 grams of aluminum hydroxide.
Formula gives the distance between two points ( : formula gives the distance between two points (x1, y1) and (x2, y2) in the Cartesian plane:
Which one of these compounds should be soluble in water : Based on the solubility rules, which one of these compounds should be soluble in water?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Java program to compare two variables if they are equal

Write down program which will ask user to initialize two character arrays, program must compare two variables if they are equal.

  Your letterinventory class must use an array

Your LetterInventory class must use an array of Counter objects. Note that there is no nextChar method in the Scanner class. You must use the next() method and then use a loop through the characters of the token that is returned. Ignore any character..

  Java program for creating a order menu

Assume your consulting company has been hired to construct a program that meets the following requirements.

  Implement simple java program to input syllabus grades

To implement simple Java program to input (hypothetical) syllabus grades, computing and displaying both normal Mean and Harmonic Mean.

  Write a program that assigns seats on an airplane

Prepare a program that teaches arithmetic to a young child. The program tests subtraction and addition. Write a program that assigns seats on an airplane.

  Loops and files

Convert an algorithm using control structures into Java and write a while loop

  The program reads in names

Write a program and include the following methods. The program reads in names and ages (use 2 parallel arrays, maximum size 50) from a file called Stuff.dat.

  Describe principles of data abstraction and inheritance

Study the principles of data abstraction, inheritance and dynamic binding. Use Library to get started on finding resources.You must take the terms and describe it.

  What position along the chord does minimum pressure occur

At what position along the chord does the minimum pressure occur? What is special about the point where C p is a maximum?

  Rock-paper-scissors :- java problem

Design decision marks are based on how you implemented our programs/classes.

  Create and implement class called date to store month

Create and Implement the class called Date which has data members to store month (as a number), day, year, and name of month.

  The williamsburg women''s club

The Williamsburg Women's Club offers scholarships to local high school students who meet any of several criteria. Write an application that prompts the user for a student's numeric high school grade point average (for example, 3.2), the student's num..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd