Help with Bluej assignment

Discussion in 'JavaScript' started by CuddyFreak, Jul 16, 2013.

  1. #1
    i have a bluej assignment and i have been suffering from a fever for the past 4 days and i have missed everything in class. This assignment represents about 32% of my grade and i really need someones help.

    this is my assignment

    Lab7

    Given class GradeBook add the following instance variables and methods to the class:

    Instance variable:

    String[] studentName;

    Methods:

    1. In all constructors, one you have the value of numberOfStudents, then create the array studentNames.

    2.public void addStudenNames()

    /* add as many student names as the size of array studentName. You will prompt the user to enter the name for student 1, then read it from user then store it in array. Keep doing this until you read all names

    */

    3.public String findTopStudentonQuiz(int quizNumber)

    /* return the first student name who has the highest score on a given quizNumber */

    4.public String findLowestStudentonQuiz(int quizNumber)

    /* return the first student name who has the lowest score on a given quizNumber */

    5.public String whoHasHighestGrade( )

    /* return the first student name who has th

    e highest score on any quiz. */

    6.public String[] listAllStudentsWithHighestGrade( )

    /* return an array of student names who all have the same highest score on any quiz. */

    7.public void printAllStudentInfo()

    / * print to the screen the screen each students name and their quiz scores

    example:

    Ahmad Damha, 76, 82, 53, 85

    Nadia Aidan, 45, 78, 86, 98

    =========================================

    there is a class that i should be working on and adding these methods to. to whoever is willing to help me i am willing to email you the class that i have.
     
    CuddyFreak, Jul 16, 2013 IP
  2. xtmx

    xtmx Active Member

    Messages:
    359
    Likes Received:
    12
    Best Answers:
    4
    Trophy Points:
    88
    #2
    This is the JavaScript section, not the Java section. They are two different languages.

    That being said, here's one of your answers:

    import java.util.Scanner;
     
    public void addStudentNames() {
     Scanner sc = new Scanner(System.in);
     int length = studentName.length;
     int index = 0;
     for(index=0;index<length;++index) {
      System.out.println("What is student name #"+index+"?");
      studentName[index] = sc.next();
     }
     sc.close();
    }
    Code (markup):
     
    xtmx, Jul 20, 2013 IP