Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

7. Writi ng short program Using a while loop, write a program to perform the following actions (8 points totall: (a) Create an empty list.

image text in transcribed
7. Writi ng short program Using a while loop, write a program to perform the following actions (8 points totall: (a) Create an empty list. (b) Ask the user to enter an integer. (c) If the integer is zero, go to step (g) (d) If the integer is divisible by 5, append it to a list (e) Otherwise ignore the integer (f) Return to step (b). (g) Print the sum of the integers on the list. (h) Exit the program. There is no need to validate the user's input, assume the user enters only legal num- bers. You are free to use any builtin function or programming construct we have dis- cussed in class to date. Here is an example of the program's output: Enter a number (or to exit): 15 Enter a number (or to exit): 12 Enter a number (or 0 to exit): -10 Enter a number (or e to exit): 11 Enter a number (or e to exit): 25 Enter a number (or to exit): 25 Enter a number (or to exit): 20 Enter a number (or 0 to exit): Total 75 mer on miege

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

Datacasting How To Stream Databases Over The Internet

Authors: Jessica Keyes

1st Edition

007034678X, 978-0070346789

More Books

Students also viewed these Databases questions