In Java 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: 1. Use two separate files – one for a main driver method and one for a VowelCounter class that keeps track of vowel counts. 2. 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. 3. Within the VowelCounter class, include these methods: o processLine ─ This method receives a line of text as a parameter and uses it to update the vowel counts appropriately. o 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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

In Java

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:
1. Use two separate files – one for a main driver method and one for a VowelCounter class
that keeps track of vowel counts.
2. 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.
3. Within the VowelCounter class, include these methods:
o processLine ─ This method receives a line of text as a parameter and uses it to
update the vowel counts appropriately.
o 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

Expert Solution
Step 1

The algorithm of the code:-

1. Create a Scanner class object to read the data.
2. Create an object of VowelCounter class.
3. Repeat forever until a new line is entered.
4. Read a line of characters from the user.
5. Pass the line of characters to the processLine() method of vowel counter.
6. Process the line of characters and update the counts in the vowel count array.
7. If a new line is entered, print the summary and break it from the loop.

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 6 steps with 4 images

Blurred answer
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education