/////////////////////////////////////////////////////////////////////////////// //Main Class File: Product.java //File: Product.java //Semester: Fall 2012 // //Author: Alicia Maxwell ////////////////////////////80 columns wide ////////////////////////////////// import java.util.Scanner; //Scanner lets us read input from the keyboard /** * Calculate the product of three integers given by the user * @author Alicia Maxwell */ public class Product { /** * This method reads three integers from the user and prints their product * @param args - Command line arguments * @return void */ public static void main(String[] args) { Scanner input = new Scanner(System.in);//used to read from keyboard int x; //first value given by user int y; //second value given by user int z; //third value given by user int result; //the product System.out.println( "Enter first integer: "); //prompt for input x = input.nextInt(); //read first integer from keyboard //Note: input validation will be learned later System.out.println( "Enter second integer: "); //prompt for input y = input.nextInt(); //read second integer from keyboard System.out.println( "Enter third integer: "); //prompt for input z = input.nextInt(); //read third integer from keyboard result = x*y*z; //calculate the product of the three input numbers System.out.printf("Product is %d\n", result); //print the result }//end main method } //end class Product