0% found this document useful (0 votes)
7 views12 pages

Java Student Grade Calculation System

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views12 pages

Java Student Grade Calculation System

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

OOPS THROUGH JAVA LAB PROJECT

ON
Student Grade Calculation System

Submitted to:
Dr. T. Praveen
Associate Professor CSE Department,
Vignana Bharathi Institute of
Technology.

Submitted By: B.
Nagaraju
24P61A0565
CSE-B.
Abstract
This project presents the implementation of a Student Grade Calculation System
designed using object-oriented principles in Java. The system processes an array of
Student objects and determines their academic grades based on predefined evaluation
criteria. The project emphasizes robust data validation through the use of custom
exceptions, ensuring that errors such as null student objects, null names, or missing
marks arrays are detected and reported accurately. The grade calculation logic
evaluates individual subject marks and the total score to assign an appropriate grade
ranging from A+ to F. In addition to validation and grading, the system provides
support functions to count null entries within the student dataset, including null
objects, null names, and null marks arrays. The entire implementation is organized
into clearly defined packages—bean, exception, service, and main—promoting
modularity and maintainability. This project demonstrates effective error handling,
data processing, and structured system design, making it a practical model for student
performance evaluation in academic or administrative applications.

1. Introduction
This project implements a Student Grade Calculation System in Java.
The system receives Student objects containing a student's name, marks, and grade.
It performs the following tasks:
• Validates the student object and its fields.
• Calculates grades based on marks.
• Throws custom exceptions when invalid data is found.
• Counts the number of null names, null marks arrays, and null objects inside
an array of Student objects.
The project is divided into four packages following a modular design.

Package 1: [Link]
Class: Student
Instance Variables:
Variable Type Description
name String Student name
marks int[] Array of marks (3 subjects)
grade String Grade calculated by the system
Package 2: [Link]
All exception classes extend Exception and override toString().
Package 3: [Link]
Class: StudentReport
Method 1: findGrades(Student studentObject)
Assumption:
Object is valid; no need to check for null entries here.
Logic
• If any mark < 35 → Grade = "F"

• Else compute sum:


sum < 150 → C sum < 200 → B
sum < 250 → A sum ≥ 250 → A+
Method 2: validate(Student studentObject)
Checks for null data; throws exceptions.
Validation Rules
1. If studentObject == null → throw NullStudentObjectException

2. If [Link]() == null → throw NullNameException

3. If [Link]() == null → throw NullMarksArrayException

4. If all valid → return result of findGrades(studentObject)


Class: StudentService
Contains 3 counting methods.
1. findNumberOfNullMarksArray(Student[] studentObjects)
Counts objects with null marks[].
2. findNumberOfNullName(Student[] studentObjects)
Counts objects with null name.
3. findNumberOfNullObjects(Student[] studentObjects)
Counts null Student objects.
All methods:
• Check array is not null.
• Iterate and count based on conditions.
Package 4: [Link]
Class: StudentMain
Used for testing:
• Creates sample student array.
• Calls services and prints results.
• Tests:
• Grade calculation
• Exception handling
• Counting functions
TEST CASES (Table Format)

TC Input Expected Result

TC1 Valid student {99,99,99} Grade = A+

TC2 Student = null NullStudentObjectException

TC3 Name = null NullNameException

TC4 Marks = null NullMarksArrayException

TC5 Null names in array Count = 2

TC6 Null objects in array Count = 2

TC7 Null marks arrays in array Count = 2

TC8 Marks contain < 35 Grade = F


Conclusion
The Student Grade Calculation System successfully demonstrates how object-
oriented programming, exception handling, and service-based design can be
combined to build a reliable and efficient application. The system accurately validates
student data, identifies missing or incorrect information through custom exceptions,
and computes grades based on predefined rules. Additional utility functions help
analyze the dataset by counting null names, null marks arrays, and null objects.
Overall, the project provides a strong foundation for academic data processing and
highlights the importance of structured design, error handling, and modular
development in Java applications.

You might also like