All pastes #914617 Raw Edit

Stuff

public text v1 · immutable
#914617 ·published 2008-02-23 01:06 UTC
rendered paste body
//Alexander Clark
//2/17/08
//CH7 7.12

import java.util.Scanner;

public class Duplicate{

	public static void main(String[] args)
	{
		Scanner input = new Scanner(System.in);

		int counter = 0;
		int counter2 = 0;
		int testValue = 0;
		int array[] = new int[5];
		int freq[] = new int[5];

		for(counter = 0; counter < array.length;)
		{

			System.out.print("Enter an integer between 10 and 100: ");

			testValue = input.nextInt();

			if(testValue >= 10 && testValue <= 100)
			{
				array[counter] = testValue;

				for(int counter2 = 0; counter2 < freq.length; counter2++)
				{
					++freq[array[counter2]];

					//blah blah check and do some shit for the duplicates

					System.out.println("");
					System.out.println("Index 0: " + array[0]);
					System.out.println("Index 1: " + array[1]);
					System.out.println("Index 2: " + array[2]);
					System.out.println("Index 3: " + array[3]);
					System.out.println("Index 4: " + array[4]);
					System.out.println("");

				counter++;

			}
			else
			{
				System.out.println("ERROR");
			}
		}

	}

}