Hello everyone. This if my first post on the forum, and hopefully my last asking for help on an assignment. I've picked and picked at this, and now I'm going insane. I've edited this one too many times, so now I figure its one of three things. My entire approach to the problem was wrong, my approach wasn't wrong but I went about it the wrong way, or I got it right but my code is messed up somewhere and the entire thing is being throw off.
Anyways, here's my assignment.
Ask the user for the number of rows (or aisles of coffee bins). Then prompt the user for the number of bins in each aisle. Create a two dimensional array to correspond to the numbers that the user entered. The array will hold numbers representing pounds. Now prompt the user for the pounds in each bin. Once all the bins are filled, display the each element in the array (in a good format) and display the total number of pounds in the coffee shop.
Here's my attempt at coding this. I hope it doesn't look too pathetic.
import java.util.Scanner;
public class CoffeeArray
{
public static void main( String args[] )
{
Scanner input = new Scanner( System.in );
int coffee[][];
int aisles;
int weight;
int total[];
int counter;
int number;
int bins;
int totalweight;
System.out.print( "Please input the number of aisles\n" );
aisles = input.nextInt();
coffee = new int [aisles][];
for ( counter = 0; coffee.length > counter; counter++)
{
number = counter + 1;
System.out.printf( "\nHow many bins are in each aisle %d?\n" , number );
bins = input.nextInt();
coffee[aisles][1] = { {aisles + counter } , {bins} };
}
System.out.print( "How much does each coffee bin weigh?\n" );
weight = input.nextInt();
total[] = { {bins * weight} };
System.out.printf( "%s%10s%10s\n", "Aisles" , "Bins" , "Weight" );
System.out.printf( "%d%10d%10d\n" "Don't know what to put here");
totalweight += total[];
System.out.printf( "The total amount of pounds is: %d" );
}
}