User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 456,556 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,446 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 260 | Replies: 2 | Solved
Reply
Join Date: Sep 2007
Posts: 13
Reputation: iCez is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
iCez iCez is offline Offline
Newbie Poster

Help Need help..

  #1  
Oct 16th, 2007
Can anyone help me debug this, I am getting a lot of errors.

here's the example case:

User inputs..

Enter Row: 3
Enter Column: 3

Output

1 2 3
2 4 6
3 6 9


Here's my code:

import java.io.*;
public class Test2 
{
public static InputStreamReader reader=new 
InputStreamReader (system.in);
public static BufferedReader input=new 
BufferedReader (reader);
public static void main (String args[]) throws Exception{
	String row;
	String col;
	
System.out.println ("Enter Row:");
row = input.readLine();
System.out.println ("Enter Column:");
col = input.readLine();

int [][] x = {{0,1,2,3,4,5,6,7,8,9,10},
	          {1,2,4,6,8,10,12,14,16,18,20},
		  {2,3,6,9,12,15,18,21,24,27,30},
		  {3,4,8,12,16,20,24,28,32,36,40},
		  {4,5,10,15,20,25,30,35,40,45,50},
		  {5,6,12,18,24,30,36,42,48,54,60},
		  {6,7,14,21,28,35,42,49,56,63,70},
		  (7,8,16,24,32,40,48,56,64,72,80),
		  {8,9,18,27,36,45,54,63,72,81,90},
		  {9,10,20,30,40,50,60,70,80,90,100},
		  {10,20,30,40,50,60,70,80,90,100,110}};

int row, col;
for (row=0; row<11; row++){
for (col=0; col<11; col++){
System.out.print (" " + x [row][col]);
}
System.out.println();
}
}
}
AddThis Social Bookmark Button
Reply With Quote  
Join Date: May 2007
Location: USA
Posts: 3,090
Reputation: Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold Ezzaral is a splendid one to behold 
Rep Power: 15
Solved Threads: 307
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Posting Sensei

Re: Need help..

  #2  
Oct 16th, 2007
The compiler gives you more information than just "errors".

Post the errors and what you think might be the reason for them. You need to learn how to interpret those messages and deal with the cause. Throwing up your hands and saying "I have errors!" won't get you too far.
Reply With Quote  
Join Date: Sep 2007
Posts: 13
Reputation: iCez is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
iCez iCez is offline Offline
Newbie Poster

Re: Need help..

  #3  
Oct 16th, 2007
yeah.. xD I just finished fixing it. I found out that there are some mistakes in symbols and somebody taught me some lacking statements.

thx for the reply.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Java Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the Java Forum

All times are GMT -4. The time now is 5:35 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC