Answered step by step
Verified Expert Solution
Link Copied!

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.

image text in transcribed

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

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

Current Trends In Database Technology Edbt 2006 Edbt 2006 Workshops Phd Datax Iidb Iiha Icsnw Qlqp Pim Parma And Reactivity On The Web Munich Germany March 2006 Revised Selected Papers Lncs 4254

Authors: Torsten Grust ,Hagen Hopfner ,Arantza Illarramendi ,Stefan Jablonski ,Marco Mesiti ,Sascha Muller ,Paula-Lavinia Patranjan ,Kai-Uwe Sattler ,Myra Spiliopoulou ,Jef Wijsen

2006th Edition

3540467882, 978-3540467885

More Books

Students also viewed these Databases questions