Answered step by step
Verified Expert Solution
Question
1 Approved Answer
PLEASE DONT USE ARRAYS. You are given a long text to analyze it. You are asked to implement a Java program called TextStatistics.java that computes
PLEASE DONT USE ARRAYS.
You are given a long text to analyze it. You are asked to implement a Java program called TextStatistics.java that computes some word statistics Given a text, you will compute: The number of sentences The number of words The greatest word of the whole text ("Troy" is same with "troy", but it is greater than "asia".) The smallest word of the whole text ("asia" is smaller than "troy".) The number of words with 1-2-3-4-5-more characters . Your program gets a text as an input from the user and returns the statistics as below. Assume that the text entered has at least one sentence, each ending with a period ("."), and each sentence includes at least one word. The greatest and the smallest words will be printed in lower case (e.g., The greatest word you) The sample outputs of the program are as below Sample Outputs: Enter a text: You are given a short text The # of sentences : 1 The # of words :6 The greatest word :you The smallest word :a The # of words with 1 char :1 The # of words with 2 char :0 The # of words with 3 char :2 The # of words with 4 char :1 The # of words with 5 char :2 The # of words with >5 char:0 Enter a text: Troy was a city situated in the far northwest of the region known in late Classical antiquity as Asia Minor now known as Anatolia in modern Turkey. The present-day location is known as Hisarlik. It was the setting of the Trojan War described in the Greek Epic Cycle in particular in the Iliad one of the two epic poems attributed to Homer The # of sentences :3 The # of words :62 The greatest word :was The smallest word:a The # of words with 1 char :1 The # of words with 2 char :15 The # of words with 3 char : 15 The # of words with 4 char :6 The # of words with 5 char :9 The # of words with >5 char: 16
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started