/* EdSoft Project

  This is main class for EdSoft project that allows user to enter student/s grade/s and then

  calculates their totals and final grade and displays them . 

 

  Author: Ahmad Mobasseri    

*/

import java.util.Scanner;

 

public class Grades

{

      public static void main(String args[])

      {

            System.out.println("This software is used to record & grade student/s grades.");

            ManyStudents manyStudents;

            manyStudents = new ManyStudents();

            System.out.println("Enter one of the options below:");

            String cmd;

            Scanner scanner = new Scanner(System.in);  

            do

            {

                  menu();

                  cmd = scanner.next();

                  switch(cmd.charAt(0))

                  {

                  case 'e': manyStudents.enterStudents();

                          break;

                  case 's': manyStudents.findAStudent();

                                break;

                  case 'm': manyStudents.modifyStudents();

                                break;

                  case 'd': manyStudents.displayStudents();

                                break;

                  case 'f': manyStudents.displayForm();

                                break;

                  case 'q': System.out.println("Good Bye");

                                break;

              default:  System.out.println("\n!?! Invalid entry. Try again");

                  }

                 

            }while( ! cmd.equals("q")); 

      }

     

//  This method displays a menu of action options, prompting user to choose one.   

      public static void menu( )

      {

            System.out.println("e    to enter student/s' grades");

            System.out.println("s    to search a student's grades");

            System.out.println("m    to modify students gradess");

            System.out.println("d    to display students grades");

            System.out.println("f    to display a grading form");

            System.out.println("q    to quit");

      }

}