Student Management System: Java Project with Detailed Implementation

Verified

Added on  2019/09/21

|32
|3539
|212
Practical Assignment
AI Summary
This Java project implements a Student Management System with a range of functionalities. The system allows users to add new student details, view all student information, calculate and view the average of overall marks, and display students based on their performance relative to the average. It also provides options to view student details by grade, ID, and full name, as well as to view the top-performing students. Additionally, the system supports sorting and displaying student details by ID and last name. The provided code includes two Java files: `Student.java`, which defines the Student class with attributes like name, ID, marks, and methods for calculating grades and overall marks; and `Client.java`, which contains the main method and user interface, allowing users to interact with the system through a menu-driven approach. The system reads student data from a text file and provides options for various operations, including adding new records, viewing details, and sorting data. The solution demonstrates practical application of Java programming concepts, including object-oriented design, file handling, and user input/output.
Document Page
Contents
Title..................................................................................................................................................2
Requirements/Specification.............................................................................................................2
User Guide.......................................................................................................................................2
Structure/Design/Algorithm............................................................................................................3
Limitations.......................................................................................................................................3
Testing.............................................................................................................................................5
Source program listings...................................................................................................................5
Student.java.................................................................................................................................5
Client.java..................................................................................................................................14
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Title
Each student has their own title (Mr, Miss, Ms, Mrs) , first name, second name, id, date of birth,
marks of three subjects, grade and overall marks.
Requirements/Specification
There are 11 options are provided to user to play with. These options are defined the all program
functionalities or specification and the user desired requirements in almost.
User can :
1. add new student details into system
2. view the all student’s brief details
3. average of all students's over all marks
4. view the students name who have the overall marks either equal to or above or below to
average of overall marks for all students
5. view student details for grades
6. view the student details according to passed student id
7. view the student details according to passed student full name
8. View Student details for first and second heighest overall marks
9. sorting and displaying the student details by id
10. sorting and displaying the student details by last name
11. quite
User Guide
You have to just open my project into netbeans. The student text file is already defined in source
folder, there is no need to do extra effort for this.
Document Page
Structure/Design/Algorithm
Limitations
Document Page
1. The text file must be as I designed it already, any other format will not be accepted.
2. There are no option to get the each student marks as percentage.
3. Currently after any updating in the student code or in addition of new student record in
student array. My system is not saving this into student.txt file.
4. The file name is hardcoded not asked by the user.
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Testing
1. I did many test on my code line null pointer exception: success there is no more null
pointer exception occur in running of code.
2. Test2: If system fails to find the file then an appropriate message is displayed to user:
success message is displayed to user.
3. Test3: The student details are find by id and name if exists if not then a message will be
displayed to user: this is successfully done.
4. Test4: the user able to view the Student’s details sorted by last name: this is also
successfully done.
5. Test5: the user able to view the Student’s details sorted by id: this is successfully
completed.
Source program listings
Student.java
public class Student {
private String title;// student title Mr, Miss, Ms, Mrs
private String fName;// student first name
private String lName;// student last name
private long stuID;// student unique id
private int day;// student dob day
private int month;// student dob month
private int year;// student dob year
private char grade;// student grade
Document Page
private double[] marks;// student marks
private double overAllMarks;// student overAllmarks
// constructor to initailize the student
public Student(String t, String fn, String ln, long id, int d, int m, int y,double[] mrks) {
title = t;
fName = fn;
lName = ln;
stuID = id;
day = d;
month = m;
year = y;
marks = mrks;
calculateOverAllMarks();
}
// get overall marks
public double getOverAllMarks() {
return overAllMarks;
}
// set overall marks
public void setOverAllMarks(double overAllMarks) {
Document Page
this.overAllMarks = overAllMarks;
}
public Student(String t, String fn, String ln, long id, int d, int m, int y,char g,double[]
mrks,double totalMarks) {
title = t;
fName = fn;
lName = ln;
stuID = id;
day = d;
month = m;
year = y;
grade = g;
marks = mrks;
overAllMarks = totalMarks;
}
//l get student title
public String getTitle() {
return title;
}
// set student title
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
public void setTitle(String title) {
this.title = title;
}
// get student first name
public String getfName() {
return fName;
}
// student set first name
public void setfName(String fName) {
this.fName = fName;
}
// student get last name
public String getlName() {
return lName;
}
// student set last name
public void setlName(String lName) {
this.lName = lName;
}
// student get student id
Document Page
public long getStuID() {
return stuID;
}
// set student id
public void setStuID(long stuID) {
this.stuID = stuID;
}
// get day of dob
public int getDay() {
return day;
}
// set day of dob
public void setDay(int day) {
this.day = day;
}
// get month of dob
public int getMonth() {
return month;
}
Document Page
//set month of dob
public void setMonth(int month) {
this.month = month;
}
// get year of dob
public int getYear() {
return year;
}
// set year of dob
public void setYear(int year) {
this.year = year;
}
// get grade of student
public char getGrade() {
return grade;
}
// set grade of student
public void setGrade(char grade) {
this.grade = grade;
}
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
// calculating over all marks
public void calculateOverAllMarks(){
double tMarks = 0;
for(double m: this.marks){
tMarks +=m;
}
this.overAllMarks = tMarks;
calculateGrade();
}
// calculating grade of student
public void calculateGrade(){
double marks = this.overAllMarks;
if(marks >= 280){
Document Page
this.setGrade('A');
}else if(marks < 280 && marks >= 200){
this.setGrade('B');
}else if(marks <200 && marks >= 100){
this.setGrade('C');
}else if(marks < 100){
this.setGrade('D');
}
}
// get full name
public String getFullName(){
return this.getfName()+" "+this.getlName();
}
// comparing if tow student details are same
public boolean compare(Student s){
chevron_up_icon
1 out of 32
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]