Welcome

Anti Essays offers essay examples to help students with their essay writing.

Sign Up

Student Java Report

Open Document

Below is a free excerpt of "Student Java Report" from Anti Essays, your source for free research papers, essays, and term paper examples.

Programming Assignment Two
/**Created using Xcode
*Created by: Ryan Jones
*February 6, 2014
*Student.java
Student.java
public class Student
{
// private data members
private int IDnumber;
private int hours;
private int points;
private static int lastStudentID;

// the public get and set methods

public void setIDnumber()
{
lastStudentID += 1;
IDnumber = lastStudentID;
}

public int getIDnumber()
{
return IDnumber;
}

public void setHours(int number)
{
hours = number;
}

public int getHours()
{
return hours;
}

public void setPoints(int number)
{
points = number;
}

public int getPoints()
{
return points;
}

// methods to display the fields

public void showIDnumber()
{
System.out.println("ID Number is: " + IDnumber);
}

public void showHours()
{
System.out.println("Credit Hours: " + hours);
}

public void showPoints()
{
System.out.println("Points Earned: " + points);
}

public double getGradePoint()
{
return (double) (points / hours);
}

}

// ShowStudent.java
// client to test the Student class

ShowStudent.java
public class Student
{
// private data members
private int IDnumber;
private int hours;
private int points;
private static int lastStudentID;

// the public get and set methods

public void setIDnumber()
{
lastStudentID += 1;
IDnumber = lastStudentID;
}

public int getIDnumber()
{
return IDnumber;
}

public void setHours(int number)
{
hours = number;
}

public int getHours()
{
return hours;
}

public void setPoints(int number)
{
points = number;
}

public int getPoints()
{
return points;
}

// methods to display the fields

public void showIDnumber()
{
System.out.println("ID Number is: " + IDnumber);
}

public void showHours()
{
System.out.println("Credit Hours: " + hours);
}

public void...

Show More


Citations

MLA Citation

"Student Java Report". Anti Essays. 18 Dec. 2018

<http://trenmayamx.com/free-essays/Student-Java-Report-603381.html>

APA Citation

Student Java Report. Anti Essays. Retrieved December 18, 2018, from the World Wide Web: http://trenmayamx.com/free-essays/Student-Java-Report-603381.html