Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: help java prog

  1. #1
    Member
    Join Date
    Oct 2012
    Posts
    53
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default help java prog

    my multiplication table code needs to have getRow(),getColumn(),displayTable() methods
    but i dont have no idead how
    here is my unfinished code

    import java.util.Scanner;
     
     
    public class tt {
     
    public static void main(String[] args) {
     
    Scanner scanner = new Scanner(System.in);
     
    System.out.print("Enter a width: ");
    int width = scanner.nextInt();
     
    System.out.print("Enter a height: ");
    int height = scanner.nextInt();
     
    for (int i = 0; i < height; i++) {
    for (int j = 0; j < width; j++) {
    System.out.print( displayTable(i, j) + "\t" );
    }
    System.out.println("");
    }
     
    }	
    public static String displayTable(int i, int j) {
    int value = (i+1)*(j+1);
     
     
    return value+"";
    }
    public static int getRow(int height){
    int i;	
    for (i = 0; i < height; i++) {
    }
    return i;
    }
    }


  2. #2
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: help java prog

    Where are you stuck?
    Do you know what a method is?
    Do you know the signature of a method?
    Are these methods supposed to return values as suggested by the names of two of them?
    What part are you having problems with?

Similar Threads

  1. Help with prog please.
    By Flantoons in forum What's Wrong With My Code?
    Replies: 0
    Last Post: October 15th, 2011, 05:10 AM
  2. Socket related prog
    By amitabh in forum Java Networking
    Replies: 1
    Last Post: March 18th, 2011, 08:47 AM
  3. how to write servlet nd jsp prog. in netbeans
    By javaking in forum Java IDEs
    Replies: 1
    Last Post: December 20th, 2010, 10:12 PM
  4. need help prog skipping method
    By Pulse_Irl in forum What's Wrong With My Code?
    Replies: 4
    Last Post: February 11th, 2010, 08:57 AM