// ITI 1120 
// Name: Diana Inkpen, Student# 123456

//import java.io.*;

/**
 * This program computes the average of three costs (for three books).
 */

class Average
{
    public static void main (String[] args)
    {
        // DECLARE VARIABLES/DATA DICTIONARY 

        double cost1; // GIVEN three costs
        double cost2; // GIVEN
        double cost3; // GIVEN
        
        double avgCost;  // RESULT: average cost

        // PRINT OUT IDENTIFICATION INFORMATION
        System.out.println();
        System.out.println("ITI 1120 Example");
        System.out.println("Name: Diana Inkpen, Student# 123456");
        System.out.println();


        // READ IN GIVENS
        
        System.out.println( "Enter the first number:" );
        cost1 = ITI1120.readDouble( );
        
        System.out.println( "Enter the second number:" );
        cost2 = ITI1120.readDouble( );
        
        System.out.println( "Enter the third number:" );
        cost3 = ITI1120.readDouble( );
        
        // CALLS THE ALGORITHM
     
        avgCost = average(cost1, cost2, cost3);
            
        // PRINT OUT RESULTS AND MODIFIEDS
        
        System.out.println( "The average cost is " + avgCost);

    }

     /**
     * This method computes the average of three numbers.
     */
     public static double average ( double num1,  double num2,  double num3)
     {  
       // VARABLE DECLARATIONS  
        double avg;  // RESULT: average of num1, num2, num3
        
        //BODY OF THE ALGORITHM
        
        avg = (num1 + num2 + num3) / 3;
        
        // RETURN RESULTS
        return avg;
     }   
} 
