The following program reads three positive integer numbers x, y, and z entered by the user. It checks whether or not all the numbe are positive. Then, it calculates and prints the total and the average of the 50% of the input numbers. The result should be printed w 2 decimal points. If at least one of the input numbers is not positive, the program prints an error message Complete the missing parts of the following code by drag and drop the appropriate statements shown below. print (total= %.2f average = %.21 %(total, average) average total /3 print (total%2d average %2d %(total, average) if (>0 and y>0 and z>0): total-x0.5+ y05 - 20.5 if (x>0 or y>0 or 2-0): print ("Numbers are not positive) total x0.5+ y"0.5 20.5 else: xyz (input (Enter 3 integer numbers: "split

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.7: Do While Loops
Problem 3E: (Misc. application) a. Write a program to reverse the digits of a positive integer number. For...
icon
Related questions
icon
Concept explainers
Question
The following program reads three positive integer numbers: x, y, and z entered by the user. It checks whether or not all the numbers
are positive. Then, it calculates and prints the total and the average of the 50% of the input numbers. The result should be printed with
2 decimal points. If at least one of the input numbers is not positive, the program prints an error message.
Complete the missing parts of the following code by drag and drop the appropriate statements shown below.
print (total= %.2f
average = %.2f" % (total, average))
average = total /3
print ("total= %2d average = %2d %(total, average))
if (x>0 and y>0 and z>0):
total = x*0.5+y*0.5 + 2*0.5
if (x>0 or y>0 or z>0):
print ("Numbers are not positive")
total x**0.5+ y**0.5 20.5
else:
x, y, z = (intox), int(y), int(z))
xyz = (input ("Enter 3 integer numbers: ")).split()
Transcribed Image Text:The following program reads three positive integer numbers: x, y, and z entered by the user. It checks whether or not all the numbers are positive. Then, it calculates and prints the total and the average of the 50% of the input numbers. The result should be printed with 2 decimal points. If at least one of the input numbers is not positive, the program prints an error message. Complete the missing parts of the following code by drag and drop the appropriate statements shown below. print (total= %.2f average = %.2f" % (total, average)) average = total /3 print ("total= %2d average = %2d %(total, average)) if (x>0 and y>0 and z>0): total = x*0.5+y*0.5 + 2*0.5 if (x>0 or y>0 or z>0): print ("Numbers are not positive") total x**0.5+ y**0.5 20.5 else: x, y, z = (intox), int(y), int(z)) xyz = (input ("Enter 3 integer numbers: ")).split()
Expert Solution
steps

Step by step

Solved in 5 steps with 2 images

Blurred answer
Knowledge Booster
Control Structure
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning