Hi!I'm new in java so I really need your help.
The problem is how do I return a value if I made another choices again and again..
here's the expected output:
Enter size of class:
Choose Action:
[1]Enter a Student
[2]Enter list of student
[3]Exit
Enter choice[1-3]
I created some of the code but not yet finished:(
import java.util.Scanner;
public class studentlist {
public static void main(String []args){
Scanner sc=new Scanner(System.in);
String student[]=new String[50];
int size,choice,x,i;
System.out.println("Enter size of class");
size=sc.nextInt();
System.out.println("Choose Action:");
System.out.println("[1]Enter a Student");
System.out.println("[2]Enter list of Student");
System.out.println("[3]Exit");
System.out.println("Enter Choice[1-3]" + "");
choice=sc.nextInt();
if(choice==1)
{
System.out.println("Enter a Student:");
for(x=0;x<size;x++)
{
student[x]=sc.next();
}
}