Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a simple program: We want to create a program that reads integer values and displays the average of those that are even, and those
Write a simple program:
We want to create a program that reads integer values and displays the average of those that are even, and those that are odd. The program should accepts input values until the user enters 999. We have the following fill-in template: print("This program calculates the average of even and odd numbers.") # Initialize accumulators and counters total_even = total_odd = count_even = count_odd = # Process input values )) while ...if % 2 == 0: ....total_even += ...count_even += ....else: ...total_odd += ..count_odd += )) ..count_odd += )) # Calculate averages if > ....print("Average of even numbers is", else: ....print("No even numbers input.") if ) ....print("Average of odd numbers is", else: ....print("No odd numbers input.") From the group of expressions below, drag into the appropriate places above the blocks needed to complete the program. avg_odd total_odd input int count_even x 1 count_odd -1 avg_even 0 999 "Enter nro.." total_evenStep by Step Solution
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