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 square 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. total = x2 + y2 + z**2 if (x>0 or y>0 or z>0): if (x>0 and y>0 and z>0); total = x*2 + y^2 + 2*2 else: average = total/3 print("total = %.2f average = %.2f" % (total, average)) x, y, z = (int(x), int(y), int(z)) print ("Numbers are not positive") xy.z= (input("Enter three integer numbers: ")).split() print("total = %2d average = %2d" % (total, average))

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
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 square 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.
total = x**2 + y**2 + z**2
if (x>0 or y>0 or z>0);
if (x>0 and y>0 and z>0);
total = x2 + y2 + 2*2
else:
average = total/3
print("total = %.2f average = %.2f" %(total, average))
x, y, z = (int(x), int(y), int(z))
print ("Numbers are not positive")
x,y,z= (input("Enter three integer numbers: ")).split()
print("total = %2d average = %2d" %(total, average))
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 square 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. total = x**2 + y**2 + z**2 if (x>0 or y>0 or z>0); if (x>0 and y>0 and z>0); total = x2 + y2 + 2*2 else: average = total/3 print("total = %.2f average = %.2f" %(total, average)) x, y, z = (int(x), int(y), int(z)) print ("Numbers are not positive") x,y,z= (input("Enter three integer numbers: ")).split() print("total = %2d average = %2d" %(total, average))
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Mathematical functions
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
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT