// ITI 1120 // Name: Diana Inkpen, Student# 123456 //import java.io.*; /** * This program computes the average of three costs (for three books). */ class Average2 { 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 // 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( ); // ALGORITHM avgCost = (cost1 + cost2 + cost3) / 3; // PRINT OUT RESULTS AND MODIFIEDS System.out.println( "The average cost is " + avgCost); } }