Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Help with SIMPLE Java programs! There are 2 simple programs, 1st one in 1st picture and the 2nd one in 2nd picture. The 3rd picture

Help with SIMPLE Java programs!
There are 2 simple programs, 1st one in 1st picture and the 2nd one in 2nd picture. The 3rd picture is the evaluation criteria (what I'm being graded on) so please follow it
Thank you
image text in transcribed
image text in transcribed
image text in transcribed
Program 1: Sentence Analysis Write a program to read a sentence (a String) entered by the user and display the following statistics: 1. the number of words in the sentence: 2. the length of each word (the number of characters): 3. the length of the longest word; 4. the length of the shortest word: 5. the average length of words. Here is an example of how your program should behave (assume that the data in grey has been entered by the user: Welcome to the SENTENCE ANALYZER Please enter the sentence to analyse: Assignment 2 does not work. Here are some stats on your sentence: Word 1 has 11 characters. Word 2 has 4 characters. Word 3 has 3 characters. Word 4 has 4 characters. There are 4 words. The longest word has 11 characters The shortest word has 3 characters. The average word length is 5.5 characters. u for usin the SENTENCE ANALY2ER Thank Notes: You can assume that a sentence will always fit within a line so you can use next Line to read the sentence. A sentence will always finish with a punctuation mark (eg, a period, aquestion mark, which should not be considered as part of the last word. A word is considered to be any sequence of non-white characters. For example, they're is considered to be 1 word, but they are is considered 2 words. You can assume that the words will always be followed by l and only 1 white space (except for the last word which is followed by a punctuation)

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

Graph Databases New Opportunities For Connected Data

Authors: Ian Robinson, Jim Webber, Emil Eifrem

2nd Edition

1491930896, 978-1491930892

More Books

Students also viewed these Databases questions

Question

Who determines the work necessary to accomplish an objective?

Answered: 1 week ago