hey guys, so i've got an assignment for a class where we are to write a menu-driven program to input a directed graph from the keyboard in command line. the program must be designed in a modular fashing having functions carry out a number of tasks.

basically, i'll have a prompt for the user to enter certain information about a graph (number of vertices, number of edges, then the 1st edge, 2nd edge, ... , last edge based on number of vertices).

the assignment is meant to practice creating static functions and working with arrays. we will have functions computing adjacency matrix's, path matrix's, degree matrix's... and a few others.

i'm confused as to how i can have the user input info into a variable and use that to create an array based on the inputted info. so far i'm setting it up like this based on some hints the teacher gave out, can anyone help point me in the right direction and maybe explain what's up with the arrays? also, the "menu-driven" aspect is confusing..

Code:
import java.util.Scanner;
import java.io.*;

public class Graph{
   public static void main(String[] args) throws IOException{
      //All important variables are defined in the main()
      int[][] adjacency = null; //adjacency mayrix
      int[][] path = null;      //path matrix
      int[][] degree = null;    //in-out degree matrix

      int V, E;                 //number of vertices and edges

      Scanner keyBoard = new Scanner(System.in);   //keyboard scanner
      Scanner scan = null;                         //file scanner

      //read number of vertices here then      
      //allocate memory for the adjacency matrix, path matrix and degree matrix
      //...
   }


   //Here is a simple function that displays a square array.
   //Note: I have to send the square array variables defined in the main a parameter
   //to this function.
   
   public static void displayMatrix(int[][] m){
   //note: a call to this function looks like:
   //displayMatrix(adjacency); or
   //displayMatrix(path);
   
      for(int r=0; r<m.length; r++){
         for(int c=0; c<m.length; c++){
               System.out.printf("%2d",m[r][c]);
         }
         System.out.println();
      }
   }

}
if needed, i can post the actual text of the assignment if this will help explain what i mean.. Thank you very much, you guys have always been extremely helpful to me here..