When I run this code, it just prints listlist pre-requisite 1 pre-requisite 2
. And it does not allow for the user to input prerequisite 1
And prerequisite 2
. Please help.
public static String Info(Scanner my)
{
System.out.println(“How many pre-requisites does the course
have”);
Int NumPreReq1= my.nextInt();
For ( i=1; i<=NumPreReq1; I++){
System.out.println(“list pre-requisite 1”);
String PreReq = my.nextLine();
}
Return PreReq;
}