Answered step by step
Verified Expert Solution
Question
1 Approved Answer
developing a Python program to process a set of integers, using functions, including a main function. The main function will be set up to
developing a Python program to process a set of integers, using functions, including a main function. The main function will be set up to take care of the following bulleted items inside a loop: The integers are entered by the user at the keyboard, one integer at a time Make a call to a function that checks if the current integer is positive or negative Make a call to another function that checks if the current integer to see if it's divisible by 2 or not The above steps are to be repeated, and once an integer equal to 0 is entered, then exit the loop and report each of the counts and sums, one per line, and each along with an appropriate message NOTE 1: Determining whether the number is positive or negative will be done within a function; and then a call to that function will be made from within the main function. The following is what you are to do within that function: if an integer is positive, add that integer to the Positive sum increment the Positive_count by one o If the integer is negative add that integer to the Negative_sum increment the Negative_count by one O NOTE 2: Determining whether the number is divisible by 2 or not will be done within a second function; and then a call to that function will be made from within the main function. The following is what you are to do within that function: o if the integer is divisible by 2 increment the Divby2_count by one o if the integer is not divisible by 2 increment the Not Divby2_count by on NOTE 3: It's your responsibility to decide how to set up the bold-faced items under NOTE 1 and NOTE 2. That is, you will decide to set them up as function arguments, or as global variables, etc. What to submit: Your Python solution as a text file A screenshot of a run of your program, showing the output A sample program run is attached below. Bb Welcome, Homer - Blackboard L X C onlinegdb.com/online_python_compiler OnlineGDB beta online compiler and debugger for c/c++ code. compile. run. debug. share. IDE My Projects Classroom new Learn Programming Programming Questions Sign Up Login fy+11.9K GOT AN OPINION? SHARE AND GET REWARDED. ORakuten AIP Have fun taking surveys and get paid! ADS VIA CARBON Bb Edit Assignment: Lab FOUR-202 X G online python compiler - Google X Online Python Compiler - online X + About FAQ Blog Terms of Use Contact Us GDB Tutorial Credits Privacy 2016-2020 GDB Online Type here to search SPONSOR Microsoft - Build and develop apps with Azure. Free until you say otherwise. Run Debug Stop Share H Save {} Beautify main.pv Enter a non-zero integer: 98 Enter another non-zero integer: 23 Enter another non-zero integer: -170 Enter another non-zero integer: 9882 Enter another non-zero integer: 29 Enter another non-zero integer: -33 Enter another non-zero integer: 54 Enter another non-zero integer: 0 5 positive integers were entered. Sum of those positive integers is 10086 2 negative integers were entered. Sum of those negative integers is -203 4 integers were divisible by 2. 3 integers were not divisible by 2. .. Program finished with exit code 0 Press ENTER to exit console. 300 input 0 X H Paused: Language Python 30 5:16 PM 7/11/2020
Step by Step Solution
★★★★★
3.44 Rating (154 Votes )
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started