Write an expression for the average number of tickets sold per school child.

2
Write an expression for the average number of tickets sold per school child.

LANGUAGE: JAVA

CHALLENGE:

Three classes of school children are selling tickets to the school play. The number of tickets sold by these classes, and the number of children in each of the classes have been read into these variables : tickets1, tickets2, tickets3 and class1, class2, class3. Write an expression for the average number of tickets sold per school child.

SOLUTION:


(double) (tickets1 + tickets2 + tickets3) / (class1 + class2 + class3)

2 comments

Add comment