Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-24-2008, 03:11 PM
Member
 
Join Date: Jun 2008
Location: Australia
Posts: 24
javanewbie is on a distinguished road
Algorithm statement in my Java codes
Good day everyone.

I'm still confused on how the process/algorithm will work here:

Code:
// i've added + 1 to have an initial value of 1 (?) // <confused> int aiNumbers[][] = new int[Integer.parseInt(args[0])+ 1] [Integer.parseInt(args[1]) + 1]; // <confused> if(args[0].equals("0") || args[1].equals("0")) { System.out.println("0"); } else { // <confused> sorry, im a newbie. for(int iCtr=1;iCtr < aiNumbers.length; iCtr++) { for(int iCtr2=1;iCtr2 < aiNumbers[iCtr].length; iCtr2++) { aiNumbers[iCtr][iCtr2] = iCtr * iCtr2; System.out.print(aiNumbers[iCtr][iCtr2] + " "); } System.out.println(""); } }
Sorry Eranga. I still don't know how the process start and I don't even know how should I describe the process.

Would someone help me on making good algorithm statements here?



By the way, this code allows two arguments to be inputted by user to display like a 'multiplication table' depends on the 2 inputs.
Here I used multidimensional arrays.


I've tried simplier codes without arrays. But we are required to do it in a array.


Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 06-24-2008, 04:26 PM
sukatoa's Avatar
Senior Member
 
Join Date: Jan 2008
Location: Cebu City, Philippines
Posts: 527
sukatoa is on a distinguished road
Send a message via Yahoo to sukatoa
Quote:
By the way, this code allows two arguments to be inputted by user to display like a 'multiplication table'
describe what's that two arguments to be added at runtime...
What's the model of your multiplication table?

You must idendify what should be used for the row and the column.
__________________
A specific, detailed, simple, well elaborated, and "tested before asking" question may gather more quick replies. hopefully
To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 06-24-2008, 04:52 PM
Member
 
Join Date: Jun 2008
Location: Australia
Posts: 24
javanewbie is on a distinguished road
Ok here's the program works.

First, the user will be ask for 2 inputs using commandline arguments.

Then the program will display something like this:
1st no: 2 (user input)
2nd no: 5 (user input)

Display:
1 2 3 4 5
2 4 6 8 10




I have no problems regards to the validation on how many inputs are required in the program.



With those codes, how can you describe a statement with a program like this?

1st no: 8 (user input)
2nd no: 2 (user input)

Display:
1 2
2 4
3 6
4 8
5 10
6 12
7 14
8 16
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Make Java codes more simplier (Multidimensional Arrays) javanewbie JCreator 9 06-25-2008 06:48 AM
How to get error codes using java program kasipandian Web Frameworks 10 05-25-2008 07:00 PM
Soundex Algorithm Implementation in Java Java Tip java.lang 0 04-12-2008 10:40 PM
Using Java To Implement RSA Algorithm Floetic New To Java 3 04-01-2008 01:56 AM
Help with algorithm in java coco AWT / Swing 1 08-01-2007 08:45 AM


All times are GMT +3. The time now is 02:32 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org