All pastes #296682 Raw Edit

Java-newbie

public text v1 · immutable
#296682 ·published 2006-12-30 13:27 UTC
rendered paste body
import java.util.Scanner;
public class Numbers

{

	int amount;
	int sum;
	int currentInt;
	double average;


	public static void main (String[] args)
	{

		Numbers n = new Numbers();
		System.out.println("How many numbers do you want?:");
		Scanner scan = new Scanner(System.in);
		n.amount=scan.nextInt();

			
		for(int i = 0; i<n.amount; i++);
		{
			System.out.print("Write a number:");
			n.currentInt=scan.nextInt();
			n.sum =+ n.currentInt;
		}

		n.average=(n.sum)/(n.amount);

		System.out.println("You entered " + n.amount + " numbers" + " and the average is " + n.average);
	}


}