76.4k views
2 votes
This program finds the sum and average of three numbers. What are the proper codes for Lines a and b?

number1=10
number2=20
number3=30
sum=number1+number2+number3
print ("Number1 is equal to " ,number1)
print ("Number2 is equal to ", number2)
print ("Number3 is equal to ", number3)
print ("The sum is ",sum)
Line a
Line b

2 Answers

3 votes

Answer:

The codes in line A and line B are given below:

average=sum divided by 3

Step-by-step explanation:

User DougR
by
8.5k points
4 votes

Answer:

The Proper codes in Line a and Line b is given below

average=Sum/3

print (" Average is = ", average)

Step-by-step explanation:

In the given question it calculated the sum but the program does not calculate the average of the 3 numbers.The average of the 3 number is calculated by using average=Sum/3 statement so we add this code in Line a then After that print the value of average by using the print function so we add this code in Line b.

User Hymenoby
by
8.8k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.