Java Microproject2
Java Microproject2
CERTIFICATE
A PROJECT REPORT ON
“STUDENT GRADE CALCULATOR”
GROUP MEMBERS
1] SAYYED REHAN AMIN(2216690061)
2] RAYBHAN SAISH BALASHAEB (2216690058)
3] ABHALE ATHARVA VIJAY(22166900057)
CERTIFICATE
This is to certify that Mr. Abhale Atharva VIjay (2216690057)
Students of Second year of Diploma in Computer Engineering
have completed the micro project in assigned as per syllabus of “AJP(22517)”
satisfaction only for the academic year 2024-2025
Apart from the efforts of team, the success of any project depends largely on
the encouragement and guidelines of many others. We take this opportunity
to express our gratitude to the people who have been instrumental in the
successful completion of this project.
The completion of any inter-disciplinary project depends upon cooperation, co-
ordination and combined efforts of several sources of knowledge. We are
eternally grateful to our teacher Prof.Bharti M.B for his even willingness to give
us valuable advice and direction under which we executed this project.
His constant guidance and willingness to share his vast knowledge made us
understand this project and its manifestations in great depths and helped us to
complete the assigned tasks. We also acknowledge the endless contribution of
parents and friends who always encouraged us and support us their wistful
cooperation in our studies and help to complete our project within the limited
time frame helped us a lot.
INDEX
1 ABSTRACT 5
2 INTRODUCTION 6
3 CODE 7-12
4 OUTPUT 13
5 CONCLUSION 14
6 REFERENCE 15
ABSTRACT
The given Java program is an implementation of a Student Grade Calculator
using the AWT (Abstract Window Toolkit) framework. The application creates a
graphical user interface (GUI) to allow students to input their marks for five
subjects: Advanced Java, CSS, Software Testing, Operating System, and EST. It
dynamically calculates the total marks, average score, and determines the
student's grade based on the calculated average.
The GUI layout is structured using a GridLayout consisting of labels and text
fields where the user can input the marks for each subject. The input fields
include validation to ensure that only valid numeric values are entered. If
invalid input is detected, such as non-numeric characters, a custom error
dialog is displayed to inform the user of the mistake.
The ActionListener interface is implemented to handle button events for
"Calculate" and "Clear." When the "Calculate" button is pressed, the program
retrieves the values from the text fields, computes the total and average of the
entered marks, and then assigns a grade based on predefined thresholds (A, B,
C, D, F). The grade assignment is based on the average score, with grade
boundaries specified (e.g., >= 90 for grade 'A'). The "Clear" button allows the
user to reset all input fields to their default state, making it easy to recalculate
grades for another set of marks.
Additionally, the application is designed to handle window events such as
closing the window by overriding the WindowAdapter methods. The text fields
for the total marks, average score, and grade are set to be non-editable to
prevent users from altering the calculated results.
This simple yet functional application demonstrates key concepts such as
event- driven programming, error handling, and GUI design in Java, making it a
useful tool for calculating student grades interactively.
Designed with simplicity and interactivity in mind, the application ensures ease
of use through a clean layout, featuring labeled text fields for input and
buttons for calculation and clearing. The program includes input validation to
handle incorrect data entries, offering helpful error messages when needed.
This interactive tool is especially useful for students and educators to quickly
and accurately compute grades based on predefined grading criteria, making it
an effective and educational utility.
Key concepts such as event handling, GUI design, and real-time calculations are
integrated into the program, showcasing practical usage of Java's AWT
components.
CODE
import java.awt.*;
import java.awt.event.*;
public StudentGradeCalculatorAWT() {
setTitle("Student Grade
Calculator"); setSize(400, 400);
setLayout(new GridLayout(9, 2));
add(new Label("CSS:"));
tfCSS = new TextField();
add(tfCSS);
add(new Label("Software
Testing:")); tfSoftwareTesting = new
TextField(); add(tfSoftwareTesting);
add(new Label("Operating
System:")); tfOperatingSystem = new
TextField(); add(tfOperatingSystem);
add(new Label("EST:"));
tfEST = new TextField();
add(tfEST);
add(new Label("Average:"));
tfAverage = new TextField();
tfAverage.setEditable(false);
add(tfAverage);
add(new
Label("Grade:")); tfGrade
= new TextField();
tfGrade.setEditable(false);
add(tfGrade);
@Override
public void actionPerformed(ActionEvent e) {
try {
// Parsing the inputs
double advancedJava = Double.parseDouble(tfAdvancedJava.getText());
double css = Double.parseDouble(tfCSS.getText());
double softwareTesting =
Double.parseDouble(tfSoftwareTesting.getText());
double operatingSystem =
Double.parseDouble(tfOperatingSystem.getText());
double est = Double.parseDouble(tfEST.getText());
// Calculating total and average
double total = advancedJava + css + softwareTesting + operatingSystem +
est;
double average = total / 5;
https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&u
rl=https://codingzap.com/student-grading-system-
java/&ved=2ahUKEwjF1e3ngKaJAxVf1TgGHUIlFVwQFnoECBYQAQ&usg=A
OvVaw1ek5mqk9Sb-VApnX4O5jw8
https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&u
rl=https://www.tutorialspoint.com/java-program-to-calculate-student-
grades&ved=2ahUKEwjF1e3ngKaJAxVf1TgGHUIlFVwQFnoECBwQAQ&usg
=AOvVaw3uXEWgL_5B2dMXoYy-VcAE
https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&u
rl=https://www.geeksforgeeks.org/student-grade-calculator-using-java-
swing/&ved=2ahUKEwjF1e3ngKaJAxVf1TgGHUIlFVwQFnoECDYQAQ&usg
=AOvVaw2SPgoiyymZ2DEHnDSPp_Y_