Public feed #727157

Someone

public text v1 · immutable
Raw Edit
·published 2007-10-05 20:13 UTC
rendered paste body
import java.util.Scanner;

public class Assignment1
{
	public static void main( String args[] )
	{
		int x; //create a variable x to old integer
		int y;
		int z;
		int A;


		
		/* create an object named input, which is supposed to read in data
		   from the keyboard */
		Scanner input;
		input=new Scanner(System.in);
		

		System.out.println("Please enter a whole number for x: ");
		/* read in the data from the keyboard, using the method nextInt() */
		x=input.nextInt( );

		System.out.println("Please enter another whole number for y: ");
		y=input.nextInt( );

		System.out.println("Please enter another whole number for z: ");
		z=input.nextInt( );
		int A;
		A=x+y+z;
		int B;
		B=A/3;

		/* echo the entered number onto the screen*/
		System.out.println("The average is" + B + ".");
	
	}

}