Question: Create a class Average having following methods: public static void printAverage ( int totalSum, int totalNumber ) method to print average based on the arguments

Create a class Average having following methods:
public static void printAverage ( int totalSum, int totalNumber ) method to
print average based on the arguments passed
public static int computeAverage( int sum, int number ) method to actually
calculate and return the average
Call computeAverage method from printAverage method.
Create a class TestAverage having main method. Ask user to enter value of
total sum and total number. Call printAverage to calculate and print average.
Observe the exception occurring when value of total number is Zero (0)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!