lost



Write a program that reads in the names and scores of students and then
computes and displays the names of the students with the highest and
lowest scores.
A simple method of carrying out this task would be to have two parallel
arrays.

String[] names;
int[] scores;
However, you should avoid parallel arrays in your solution.
First, write a class Student to solve the parallel array problem. Leave
the StudentScores class and tester class for the following exercises. A
Student simply holds a student name and a score.
What is your Student class?

Here is my Student class...

public class Student
{
// instance variables
private String name;
private int score;
private int s;

/**
* Constructor for objects of class StudentScores
*/
public Student()
{
String name = "null";
int score = 0;
}
public String getName() // Gets the name of the Student
{
return name;
}
public int addScore(int s) // Add the new quiz grade to the others
{
score = score + s;
return score;
}

}

I can't come up with the Student Scores class though, I don't even know
where to start. Any ideas?

.



Relevant Pages

  • Re: Newbie Inheritance error
    ... public class MBAstudent extends Student { ... private int GMAT; ... public MBAstudent(double g, int gm, String fn, String ln, String ss) ... public void setData ...
    (comp.lang.java.programmer)
  • Help me please, how can I create an array of object of a my class?
    ... Here I have copied the Student, ... Studente(String, String, String, int, long); ... Studente::Studente(String nome, String cognome, String codfisc, int eta, ... void Studente::print{ ...
    (comp.lang.cpp)
  • Re: Insert with multiple subqueries - possible?
    ... Create Table Student (Stu_ID int identity PRIMARY KEY CLUSTERED, ... Create Table Student_Course (Stu_ID int NOT NULL REFERENCES Student, ... Create Table ImportStudents (Stu_Number INT NOT NULL, ...
    (microsoft.public.sqlserver.programming)
  • Re: Array Help
    ... >> How can I make an array in the student ... >> using the public void recordMarks(Module m, int eMark, int cMark) ... you could set up an array of type ModuleRecord. ... private int courseMark; ...
    (comp.lang.java.help)
  • Re: Pass-by-reference to nested function?
    ... Tricky, that, in C. C uses pass-by-value for all parameter-passing. ... Let's take a look at the student object, then, shall we? ... In C, main returns int. ... That pointer sure looks to me as if it's being passed by value. ...
    (comp.lang.c)