Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that reads a file a character at a time and prints out how many times the vowels a e i o u

Write a program that reads a file a character at a time and prints out how many times the vowels a e i o u occur (in upper- or lowercase).

Complete the following file:

Vowels.java

import java.io.File; import java.io.FileNotFoundException; import java.io.PrintWriter; import java.util.Scanner;

public class Vowels { public static void main(String[] args) throws FileNotFoundException { String vowels = "aeiou"; int[] counters = new int[vowels.length()];

Scanner console = new Scanner(System.in); System.out.print("Input file: "); String inputFileName = console.next();

. . .

for (int i = 0; i < vowels.length(); i++) { System.out.println(vowels.charAt(i) + ": " + counters[i]); } } }

(The "..." is where code needs to be added)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data And Databases

Authors: Jeff Mapua

1st Edition

1978502257, 978-1978502253

More Books

Students also viewed these Databases questions

Question

Describe Kants rationalist response to empiricist thinking.

Answered: 1 week ago

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago