I'm making a project that will display project and quiz scores for a student.
I'm done with the student class but I have to make a separate class called 'main' to display all the info.
I was told that the main method would look something like this:
but the code just becomes an infinite loop
Here are the instructions for the main method for clarification:
Create a Java class, named Main, that has a main method. The main() method of the class is a tester. We will exercise the methods of the Student class to make sure they are working properly. Any console I/O must be in the main() method or a private static method called by the main method. This Main class is only there to test the functionality of your Student class. The Student class should not do any I/O to the console (debugging output is allowed but should be removed in the final product); only the Main class' main() method should interact with the console.
Instantiate a Student object in the main() method. You should not make local copies of the Student object's arrays in the main() method, but rather only access them via the object's methods. Remember, these requirements state that no getters for the arrays in Student are allowed.
Try to display the student's information to the console. Use a loop to get project and quiz scores from the student object. This will test your code to make sure it handles a student with no project or quiz scores.
Fill the projects and quizzes for this student. Use the getNextProjectIndex() and getNextQuizIndex() methods to find the indexes in which to add the scores.
Try to go out of bounds to add a project and a quiz to the student to test the ability of the Student class's methods to handle full arrays.
Once full, display the student's information to the console. Use a loop to get project and quiz scores from the student object.
Note: I changed the above to be inside quote tags rather than code tags. Code tags don't allow text wrapping which makes viewing those long, unbroken lines of text hard, and messes up the formatting of the page. /Steve
My student class: