Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a program that uses a while loop to read in numbers from the user until the user types O, without doing anything else

Create a program that uses a while loop to read in numbers from the user until the user types O, without doing anything else with the numbers. 2. Extend the program by creating an empty list before the while loop. Next, change the loop so that for each run through it stores the number the user enters in this list. 3. After the while loop is finished, write a for loop that goes through the list and prints each individual element. 4. Extend the program with a variable minSum. Then write a new for loop that goes through the list you created earlier and adds the value of each number to minSum. (Hint: +=). Then print the sum to the user. 5. Use two separate for loops to find respectively the smallest and the largest element in the list, and print these. Here, you must arrive at the smallest and largest number in the list without using min() or max().

Step by Step Solution

3.53 Rating (150 Votes )

There are 3 Steps involved in it

Step: 1

1 Create a program that uses a while Loop to read in numbers from the user until the user types 0 wi... 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

Systems analysis and design

Authors: kenneth e. kendall, julie e. kendall

8th Edition

135094909, 013608916X, 9780135094907, 978-0136089162

More Books

Students also viewed these Programming questions

Question

Can we say that this is an application of integration by parts?

Answered: 1 week ago