question states for me to have the prog read #'s inputed from the user in the range of 0 to 50 inclusive, count how many times each # was inputed, then print all #'s imputed and how may times they were. this is what I have so far....
import java.util.Scanner;
public class ReverseOrder
{
public static void main (String[] args)
{
Scanner scan = new Scanner (System.in);
double[] numbers = new double[10 ];
double apple
System.out.println ("The size of the array: " + numbers.length);
for (int index = 0; index < numbers.length; index++)
{
System.out.print ("Enter a number between 0 and 50: " + (index+1) + ": ");
apple = scan.nextDouble();
}
so what ive done here is tell the user that he/she will have 10 entries to enter a number
then what i think i'm doing is setting the imput to the int "apple". next what i'm trying to do:
(certainly not in acceptable coding, but just trying to think/communicate it out)
if (apple = apple) // if the numbers are the same then increase the count
count++
System.out.println (number[index] + count) //print all of the numbers entered and how many times
but theres the problem, logically at least. how do i assign the count to each particular int? and then get it to print out that particular count to the right int? as it stands right now im sure itll just up the count for any random int that happens to be the same. any help much appreciated