Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

write a java program that counts the frequency of letters in a written statement text and give as output the number of letters, the number

write a java program that counts the frequency of letters in a written statement

image text in transcribed

text and give as output the number of letters, the number of string tokens, and a table giving the frequency of each letter. For example, Enter a single line of text: Now is the time for all good men to come to the aid of their country The line contains 53 letters. The line contains 16 string tokens The frequency of letters is A2 c -2 H 3 L--2 M3 N3 0 R3 T--7 U--1 W-1 Y-1 The table of letter frequencies must use capital letters (as above), but can be in more than one column. Use an array to store the letter frequencies. Name the program ScanningText.java. Hint: Read the line of text into a string variable using the nextLine method, string 1inei line = input.nextLine(); and later use int ch, counti for (ch achz cht+) -Count the number of occurrences of ch in the line -Print the count if0

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions