S
SpeedRunner
Guest
Hey, I managed to finish this assignment and have it working properly 3 days before it's due. 
It's the same one as this thread: http://hardforum.com/showthread.php?t=1016938
My question though, is how do I generate an HTML document for the javadoc? I know I have to work some kind of magic in command prompt but I haven't been able to get it to work. Also if you want to take a look at my program and critique it, thats fine.
It's the same one as this thread: http://hardforum.com/showthread.php?t=1016938
My question though, is how do I generate an HTML document for the javadoc? I know I have to work some kind of magic in command prompt but I haven't been able to get it to work. Also if you want to take a look at my program and critique it, thats fine.
Code:
/**
This simply provides a driver to exercise the exciting
Student class.
@see Student
@author Marshall Harris
@version StuList
@since ver 1.0
*/
public class StuList
{
/**
Should not instantiate!
*/
private StuList(){};
public static void main(String[] args)
{
Student[] stus = new Student[4];
stus[0] = new Student(123,"Fred",3.4);
stus[1] = new Student(234,"Suzy");
stus[2] = new Student(345,4.0);
stus[3] = new Student(456);
stus[1].setGPA(3.9);
stus[3].setName("Betty");
for(int i=0; i<stus.length; i++)
{
System.out.println(stus[i]);
System.out.println(stus[i].getName() + " has number " + stus[i].getNumber() + "\n");
}
}
}
/**
The Student class encapsulates a student's name, student number, and gpa.
The student number cannot be changed once the Student object is constructed,
but the other members can be reset by means of "set" methods.
*/
class Student
{
/**
*Creates variables
*/
private int number;
private String name;
private double GPA;
/**
Constructs a new Student, given a name, Student number, and gpa.
*/
public Student(int n, String m, double g)
{
number = n;
name = m;
GPA = g;
}
/**
Constructs a new Student, given Student number and gpa, with the Student's
name defaulting to something of the form "Student 123" by means of a "this" call.
*/
public Student(int number, double GPA)
{
this(number, "Student " + number, GPA);
}
/**
Constructs a new Student, given just a Student number,
with other values defaulting through a set of chained "this" calls.
*/
public Student(int number)
{
this(number, "Betty", 0.0);
}
/**
Constructs a new Student, given a name and student number,
with gpa defaulting to 0.0 by means of a "this" call.
*/
public Student(int number, String name)
{
this(number, name, 0.0);
}
/**
Changes the Student's gpa.
*/
public double setGPA(double g)
{
GPA = g;
return GPA;
}
/**
Changes the Student's name.
*/
public String setName(String n)
{
name = n;
return name;
}
/**
Retrieves the Student's name.
*/
public String getName()
{
return name;
}
/**
Retrieves the Student's number.
*/
public int getNumber()
{
return number;
}
/**
Retrieves a String represetnation of all the Student's data fields separated by commas.
*/
public String toString()
{
return (name + ", " + number + ", " + GPA);
}
}