Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I SHOULD USE WHILE LOOPS. I SHOULD'NT USE ARRAYS.PLEASE NOTCE THAT Prelab Assignment 04 (Lab 07) CMPE 112 Fundamentals of Programming I, Fall 2017 You
I SHOULD USE WHILE LOOPS. I SHOULD'NT USE ARRAYS.PLEASE NOTCE THAT
Prelab Assignment 04 (Lab 07) CMPE 112 Fundamentals of Programming I, Fall 2017 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
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