Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program 1. Generate a random number between 3 and 6 words to ask for 2. Display: I'll need [number] words: that does

Write a program 1. Generate a random number between 3 and 6 words to ask for 2. Display: I'll need [number]

Write a program 1. Generate a random number between 3 and 6 words to ask for 2. Display: I'll need [number] words: that does the following: 3. Proceed to ask for each word, one at a time: Word #[number] please > 4. At the end, your program should print out : (a) the longest word (the most recently entered longest if there is a tie) (b) the shortest word (the most recently entered shortest if there is a tie) (c) the average length of all of the words (up to the second decimal point) Longest: program Average Length: 4.75 , inclusive - this will determine how many Sample examples (the user input is in red, the printed output is in blue, and the prompt is in black): I'll need 4 words: Word #1 please > wow Word #2 please > oh I'll need 3 words: Word #1 please > hi Word #2 please > hi Word #3 please > hi Shortest: hi Word #3 please > amazing Word #4 please > program Shortest: oh Longest: hi Average Length: 2.00 I'll need 5 words: Word #1 please > hello Word #2 please > computer Word #3 please > python Word #4 please > world Word # 5 please > homework Shortest: world Longest: homework Average Length: 6.40

Step by Step Solution

3.41 Rating (154 Votes )

There are 3 Steps involved in it

Step: 1

It seems you have shared an image that illustrates a sample interaction with a program that asks use... 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

Introduction to Java Programming, Comprehensive Version

Authors: Y. Daniel Liang

10th Edition

133761312, 978-0133761313

More Books

Students also viewed these Programming questions