please code in Java and post screenshots of compilation Create an alphabet count
ID: 663298 • Letter: P
Question
please code in Java and post screenshots of compilation
Create an alphabet counter. The code vill read an inout file and return the number of times each lettrs i the file that is specified in the argument If the content of zytox.e 1. Create an alphabet counter. The code will read an input file and return the number of times each letter appears in the file that is specified in the argument. If the content of lazyfox.txt is The quick brown fox jumps over the lazy dog. Then the output would be: > java countMyAlphabet abcdExplanation / Answer
import java.util.*; public class Reverse { public static void main( String args[] ) { String paragraph; Scanner input = new Scanner (System.in); System.out.print("Enter a paragraph: "); paragraph = input.nextLine(); paragraph = paragraph.trim(); StringTokenizer tokens = new StringTokenizer(paragraph, "."); while (tokens.hasMoreTokens()){ String ss = tokens.nextToken(); for (int i = ss.length() - 1; i>=0; i--) { System.out.print(ss.charAt(i)); } System.out.print(". "); } System.out.println(); } }
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.