Question: 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

1 Expert Approved Answer
Step: 1 Unlock

It seems you have shared an image that illustrates a sample interaction with a program that asks use... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!