here is my code.
Scanner keyboard = new Scanner(System.in);
out.println("Welcome to the Class Stats program!");
out.print("\nWhat is the name of this class? ");
String className = keyboard.nextLine();
out.print("\nHow many students are in this class? ");
int numInClass = keyboard.nextInt();
Class myClass = new Class();
for(int x = 0; x < numInClass; x++)
{
out.print("\nEnter the name of student "+(x+1)+" :");
String stuName = keyboard.nextLine();
keyboard.next();
out.println();
out.println("Enter the grades for "+stuName);
out.print("Use the format x - grades ( 2 - 100 100) : ");
String grades = keyboard.nextLine();
keyboard.next();
out.println();
myClass.addStudent(x,new Student(stuName,grades));
}
myClass.toString();
I am calling some methods from here, like the new student() and the .toString(), bu those are working fine, my problem is how do i store the list of user imputed Booleans, in a string.
Aucun commentaire:
Enregistrer un commentaire