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

  Displays every perfect number from 1 through 1000

Write an application that displays every perfect number from 1 through 1000. A perfect number is one that equals the sum of all the numbers that divide evenly into it.

  Develop java code to compute monthly rent for housing units

Develop a java code that computes monthly rent for 3 housing units namely Bungalows,Apartments and hostels. All housing units have got size,color and monthly rental rate.

  Function using javascript syntax to compute gross pay

Write a function using JavaScript syntax to compute a person's gross pay for a week. The function must receive the number of hours worked and the rate of pay per hour.

  Java program simulate a network

Java program simulate a network

  User enter a series of numbers

Design a java program with a loop that lets the user enter a series of numbers. The user should enter - 99 to signal the end of the series. After all the numbers have been enter been entered, the program should display the largest and smallest number..

  Create four classes

Create four classes: Account.java, Checking.java, Savings.java, and AccountArray.java.

  Lambert''s vacation rentals

Write an application for Lambert's Vacation Rentals. Use separate ButtonGroups to allow a client to select one of three locations, the number of bedrooms

  Write a java applet for grade of gas in costco gas station

Write a java applet (not a java application program) for costco gas station. The applet will first ask you whether you are a costco customer, then the grade of gas you want to use.

  Write a java program called salesinfominer

Write a Java program called SalesInfoMiner that reads in a file of products, stored in text format. The program must then read in information about past sales transactions and output all the products to a new file, sorted by product description,..

  Application for an animal-fur trimming service

Create an application for an animal-fur trimming service. Write the code for the application. Prompt the user to indicate how many animals. Display the total fee for one year. Be pleasant in your output as it will be expensive.

  What is the average response time for this system?

A web server receives a request every 50ms and processes web requests every 8 ms. Using queuing theory, 1. What is the average response time for this system?

  Write a class array that encapsulates an array

Write a class Array that encapsulates an array and provides bounds-checked access. The private instance variables should be int index and inarray[10]. The public members should be a default constructor and methods (signatures shown below) to provide ..

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