0% found this document useful (0 votes)
2 views5 pages

Also Write The Coding For Netbeans Java Design Vie...

The document outlines a project report for a Java NetBeans application that includes a Student Grade Calculator and an Electricity Bill Calculator. It provides a certificate, acknowledgment, input/output specifications, and detailed Java code for both calculators. The code includes functionality for calculating grades based on scores and estimating electricity bills based on consumption and tariff rates.

Uploaded by

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

Also Write The Coding For Netbeans Java Design Vie...

The document outlines a project report for a Java NetBeans application that includes a Student Grade Calculator and an Electricity Bill Calculator. It provides a certificate, acknowledgment, input/output specifications, and detailed Java code for both calculators. The code includes functionality for calculating grades based on scores and estimating electricity bills based on consumption and tariff rates.

Uploaded by

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

Based on the handwritten pages you've provided, here is the organized content for your Java

NetBeans project report, followed by the actual Java Swing / NetBeans code required to make
both calculators functional.

1. Certificate
CERTIFICATE​

This is to certify that the practical for Information Technology
submitted by ​
name _____________________ during the academic year 2026-2027 is a
bonafied ​
piece of work conducted under supervision and guidance. The data
source ​
have fully acknowledged. I wish her/his success in his future.​


Teacher's Signature Examiner's Signature​

2. Acknowledgement
ACKNOWLEDGEMENT​

I would like to express my special thanks of gratitude to my teacher
as well ​
as our principal who gave me the golden opportunity to do this
wonderful ​
project on the topic of Student Grade Calculation and Electricity Bill ​
Calculation using Java NetBeans. ​

I am also thankful to my parents and friends who helped me a lot in ​
finalizing this project within the limited time frame.​

3. Student Grade Calculator


Introduction
The student grade calculation in JAVA is an initiative and effective, efficient Java application
designed specially to calculate student's grades based on their scores across multiple subjects.
This calculator enables users to input essential student details. Overall, this application aims to
make grade calculation a breeze, providing a clear picture of a student's performance.

Input and Output Specifications


●​ Input Components:
○​ Student Name (jTextField1)
○​ Roll Number (jTextField2)
○​ Class (jTextField3)
○​ English Score (jTextField4)
○​ Math Score (jTextField5)
○​ Science Score (jTextField6)
○​ I.T. Score (jTextField7)
●​ Output Components:
○​ Total (jTextField8)
○​ Grade (jTextField9)
○​ Average (jTextField10)

Design View Layout Structure

Program Code (Student Grade Calculator)


Attach this code to your Calculate button (jButton1) action listener in NetBeans:
private void jButton1ActionPerformed([Link] evt) {
try {​
// Fetching marks from text fields​
double english = [Link]([Link]());​
double math = [Link]([Link]());​
double science = [Link]([Link]());​
double it = [Link]([Link]());​

// Calculations​
double total = english + math + science + it;​
double average = total / 4.0;​
String grade = "";​

// Determining Grade based on average​
if (average >= 90) {​
grade = "A+";​
} else if (average >= 80) {​
grade = "A";​
} else if (average >= 70) {​
grade = "B";​
} else if (average >= 60) {​
grade = "C";​
} else if (average >= 50) {​
grade = "D";​
} else {​
grade = "F (Fail)";​
}​

// Displaying outputs​
[Link]([Link](total));​
[Link]([Link]("%.2f", average));​
[Link](grade);​

} catch (NumberFormatException e) {​
[Link](this, "Please enter
valid numeric marks!");​
}​
} ​

4. Electricity Bill Calculator


Introduction
It is a smart tool for energy expense management. In today's world, managing energy expenses
is crucial for both households & businesses. An electricity bill calculator is a valuable resource.
Designed to help you to estimate your electricity bill based on the energy consumption. This
calculation simplifies the process, providing a clean & accurate picture of the energy expenses.

Input and Output Specifications


●​ Tariff Rate Slab:
Unit Range Charge Per Unit
Less than 500 1.00
500 and above but < 600 1.80
600 and above but < 800 2.80
800 and above 3.00
●​ GUI Components:
○​ Customer ID (jTextField1)
○​ Customer Name (jTextField2)
○​ Unit Consumed (jTextField3)
○​ Calculate Button (jButton1)
○​ Print Button (jButton2)
○​ Display Output Area (jTextArea1)

Program Code (Electricity Bill Calculator)


Calculate Button Code (jButton1)

This calculates the total bill and formats it neatly into the jTextArea1 box layout shown in your
layout sheet.
private void jButton1ActionPerformed([Link] evt) {
try {​
String customerID = [Link]();​
String customerName = [Link]();​
double units = [Link]([Link]());​
double chargePerUnit = 0.0;​

// Applying the Slab Rules from your notes​
if (units < 500) {​
chargePerUnit = 1.00;​
} else if (units >= 500 && units < 600) {​
chargePerUnit = 1.80;​
} else if (units >= 600 && units < 800) {​
chargePerUnit = 2.80;​
} else {​
chargePerUnit = 3.00;​
}​

double totalBill = units * chargePerUnit;​

// Printing text formatted to display in the jTextArea​
[Link]("========= ELECTRICITY BILL =========" +
"\n" +​
"Customer ID : " + customerID + "\n" +​
"Customer Name : " + customerName + "\n" +​
"Units Consumed : " + units + "\n" +​
"Rate Per Unit : Rs. " + chargePerUnit +
"\n" +​
"------------------------------------" +
"\n" +​
"Total Amount : Rs. " + totalBill + "\n"
+​
"====================================");​

} catch (NumberFormatException e) {​
[Link](this, "Please enter
valid unit values!");​
}​
} ​

Print Button Code (jButton2)

To make your "Print" button functional so it triggers a system print dialog for your jTextArea1
document:
private void jButton2ActionPerformed([Link] evt) {
try {​
boolean complete = [Link]();​
if (complete) {​
[Link](this, "Printing
Complete", "Information",
[Link].INFORMATION_MESSAGE);​
} else {​
[Link](this, "Printing
Cancelled", "Printer Status",
[Link].WARNING_MESSAGE);​
}​
} catch ([Link] e) {​
[Link](this,
[Link]());​
}​
} ​

You might also like