Write an algorithm that gets as input three data values x, y, and z and outputs the average of these values if the value of x is positive. If the value of x is either 0 or negative, your algorithm should not compute the average but should print the error message ' Bad data' instead.
Algorithm to find Average of three Numbers is given below:
Step 1: Start
Step 2: Input 3 values x,y,z
Step 3: initialize average to 0
Step 3: If x > 0 then
average <--
(x+y+z)/3
print average
else if x <= 0
print "Bad Data"
Step 4 : Stop
Write an algorithm that gets as input three data values x, y, and z and outputs...