[go: up one dir, main page]

0% found this document useful (0 votes)
119 views30 pages

Kendriya Vidyalaya Iit-Kanpur: Grade Calculator

ip investigatory

Uploaded by

kartik
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)
119 views30 pages

Kendriya Vidyalaya Iit-Kanpur: Grade Calculator

ip investigatory

Uploaded by

kartik
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
You are on page 1/ 30

 

  
 
 
 
 
 
 
 
 
 
 
 
 

KENDRIYA VIDYALAYA  
IIT-KANPUR 
INFORMATICS PRACTICES PROJECT 

Grade Calculator 
 

Session: 2018-2019 
Guided by: Mr. Rajesh Sharma (I.P. Teacher) 
Submitted by: 
Mayank Kashyap 
Class: XII-E 
CBSE Roll No. 5699686 

 

 

Certificate 
This is to certify that ​Mayank Kashyap of class ​XII-E has
prepared the project entitled “​Grade Calculator​”. The
project is the result of his efforts and endeavours. The
project is found worthy of acceptance as final project for
the subject ​Informatics Practices of class XII. He has
prepared the report under my guidance.

(Mr. R.N. Wadalkar) (Mr. Rajesh Sharma)


The Principal PGT (Informatics Practices)
Kendriya Vidyalaya, Kendriya Vidyalaya,
IIT Kanpur IIT Kanpur

(Practical Examiner)
 

 
 
 

 

Acknowledgement 
I would like to express a deep sense of thanks and
gratitude to my ​Informatics Practices teacher ​Mr. Rajesh
Sharma Sir for guiding me immensely through the course
of the project. He always evinced keen interest in my
work. Her constructive advice and constant motivation
have been responsible for the successful completion of
this project.
My sincere thanks goes to ​Shri R.N. Wadalkar​, our
principal sir, for this coordination in extending every
possible support for the completion of this project.
I also thank to my parents for their motivation and support.
Last but not the least, I would like to thank all those
who had helped directly or indirectly towards the
completion of this project.

Mayank Kashyap
Class: XII-E
CBSE Roll No. 5699686

 
 

 

Contents 
● About the project………………………………………………….​4 
● System Implementation…………………………………….​5-6 
(Hardware and Software Used) 
● Netbeans…………………………………………………………..​7-8 
● MySQL………………………………………………………..………...​9 
● Database Structure……………………………………….…...​10 
● Imported Files…………………………………………………....​11 
● How the program works?....................................​12-21 
(Screenshots of Program) 
● Codings………………………………………………………….​22-26 
● Objective…………………………………………………………....​27 
● Conclusion……………………………………………………….…​28 
● Bibliography……………………………………………………….​29 

 
 
 
 
 

 

About the Project 


The  project  titled  “Grade  Calculator”  is  management 
software  for  calculating  and  saving  student’s  records  in 
a  school.  This  project  is  designed  and  coded  in 
Netbeans  and  database  management  is  handled  by 
MySQL.  This  software  mainly  focuses  on  basic 
operations  in  school  made  by  teachers  like  calculation 
of  marks  total, percentage and grade, this program also 
gives  remarks  according  to  the  percentage  of  student, 
basically  it  is  useful  for  result  creation  of  students  in  a 
school  and  also  maintaining  the  records.  “Grade 
Calculator”  is  a  java  application  written  on  64-bit, 
macOS  High  Sierra  operating  system,  designed  to  help 
teachers  maintain  and  organise  student’s  result.  This 
software  is  easy  to  use  for  both  beginners  and 
advanced users. 
 

 
 
 
 

 

System Implementation 
Hardware Used: 
★Computer:​ Apple iMac 

 
★Manufacturer:​ ​Apple Inc. 
★Model:​ iMac (21.5-inch, Mid 2011) 
★Processor:​ 2.5 GHz Intel Core i5 
★Memory:​ 4 GB 1333 MHz DDR3 
★Graphics:​ AMD Radeon HD 6750M 512 MB 
★System Type:​ 64-bit Operating System 
 
 
 
 

 

Software Used: 
➢macOS High Sierra Copyright © 1983-2018 Apple 
Inc. All Rights Reserved. 
➢Google Docs 

 
➢Java 

 
➢Net beans (front-end) 

 
➢MySQL (back-end) 

 
 

 

Netbeans 
NetBeans  is  an  integrated  development  environment 
(IDE)  for  Java.  NetBeans  allows  applications  to  be 
developed  from  a  set  of  modular software components 
called  modules.  NetBeans  runs  on  Windows,  macOS, 
Linux  and  Solaris.  In  addition  to  Java  development,  it 
has  extensions  for  other  languages  like  PHP,  C,  C++, 
HTML5,  and  JavaScript.  Applications  based  on 
NetBeans,  including  the NetBeans IDE, can be extended 
by third party developers. 

NetBeans platform 
The  NetBeans  Platform  is  a  framework  for  simplifying 
the  development  of  Java  Swing  desktop  applications. 
The  NetBeans  IDE  bundle  for  Java  SE  contains  what  is 
needed  to  start  developing  NetBeans  plugins  and 
NetBeans  Platform  based  applications;  no  additional 
SDK is required. 
Applications  can  install  modules  dynamically.  Any 
application  can  include  the  Update  Center  module  to 
allow  users  of  the  application  to  download  digitally 
signed  upgrades  and  new  features  directly  into  the 
running application.  

 

Reinstalling  an  upgrade or a new release does not force 


users to download the entire application again. 
The  platform  offers  reusable  services  common  to 
desktop  applications,  allowing  developers  to  focus  on 
the  logic  specific  to  their  application.  Among  the 
features of the platform are: 
● User  interface  management  (e.g.  menus  and 
toolbars) 
● User settings management 
● Storage  management  (saving  and  loading  any  kind 
of data) 
● Window management 
● Wizard framework (supports step-by-step dialogs) 
● NetBeans Visual Library 
● Integrated development tools 

NetBeans IDE 
NetBeans  IDE  is  an  open-source  integrated 
development  environment.  NetBeans  IDE  supports 
development  of  all  Java  application  types  (Java  SE 
(including  JavaFX),  Java  ME,  web,  EJB  and  mobile 
applications)  out  of  the  box.  Among  other  features  are 
an  Ant-based  project  system,  Maven  support, 
refactorings,  version  control  (supporting  CVS, 
Subversion, Git, Mercurial and Clearcase). 

 

MySQL 
MySQL  is  an  open  source  relational  database 
management  system  (RDBMS).  Its  name  is  a 
combination  of  "My",  the  name  of  co-founder  Michael 
Widenius  daughter,  and  "SQL",  the  abbreviation  for 
Structured Query Language. 
 
MySQL  is  free  and  open-source  software  under  the 
terms  of  the  GNU  General  Public  License,  and  is  also 
available  under  a  variety of proprietary licenses. MySQL 
was  owned  and  sponsored  by  the  Swedish  company 
MySQL  AB,  which  was  bought  by  Sun  Microsystems 
(now  Oracle  Corporation).  In  2010,  when  Oracle 
acquired  Sun,  Widenius  forked  the  open-source  MySQL 
project to create MariaDB. 
 
MySQL  is  a  component  of  the  LAMP  web  application 
software  stack  (and  others),  which  is  an  acronym  for 
Linux,  Apache,  MySQL,  Perl/PHP/Python.  MySQL is used 
by  many  database-driven  web  applications,  including 
Drupal,  Joomla,  phpBB,  and  WordPress.  MySQL  is  also 
used  by  many  popular  websites,  including  Google 
(though  not  for  searches),  Facebook,  Twitter,  Flickr, and 
YouTube.  
10 
 

Database Structure 
Admin Data 

 
Result Data 

 
 
 
 
11 
 

Imported Files 
import java.awt.Color; 
import java.awt.HeadlessException; 
import java.sql.PreparedStatement; 
import java.sql.ResultSet; 
import java.sql.Connection; 
import java.sql.DriverManager; 
import java.sql.SQLException; 
import java.sql.Statement; 
import javax.swing.JOptionPane; 
import javax.swing.border.LineBorder; 

 
 
 
 
 
 
 
12 
 

How does Grade Calculator works? 

This is the login 


panel for Grade 
Calculator 
 
 
 
 
 
 
 
 
This is the login 
panel for Grade 
Calculator after 
filling login details 
 
 
 
 
13 
 

 
 
 
 
You can press the 
cancel button to 
cancel login 
 
 
 
 
 
 
This error will come when 
Username field is empty 
 
 
 
 
This error will come when 
Password field is empty 
 
 
 
 
 
14 
 

 
This error will come 
when Username and 
Password both fields 
are empty 
 
 
This error will come 
when Username and 
Password are 
incorrect 
 
 
This message will come 
when Username and 
Password both are 
correct 
 
 
 
 
 
 
 
 
 
15 
 

 
 
 
 
 
 
 
 
This window will be 
opened when 
Username and 
Password both are 
correct 
 
 
 
 
 
 
 
This Username and 
Password are fetched from 
this table 
 
 
 
16 
 

 
 
 
 
 
 
 
This is the Grade 
Calculator when 
student’s details 
are filled and total 
marks, percentage 
and grade is ready 
to be calculated 
 
 
 
 
 
 
 
 
 
 
 
 
17 
 

 
 
 
 
 
 
This is the Grade 
Calculator when 
student’s details 
are filled and total 
marks, percentage 
and grade is ready 
to be calculated 
 
 
 
 
 
 
 
 
 
 
 
 
 
18 
 

 
 
 
 
 
 
 
You can press this 
save button, to save 
the student’s data 
in the MySQL 
database 
 
 
 
 
 
 
 
 
 
 
 
 
 
19 
 

This is the table which is connected to grade 


calculator 

 
This message will come 
when save button is 
pressed and if the entry is 
valid 
 
 
 
 
 
 
 
 
 
 
 
 
20 
 

 
 
 
 
 
 
 
 
You can press the 
clear button to 
clear all the text 
fields 
 
 
 
 
 
 
 
This confirmation window will appear when you 
press clear button 
 
 
 
 
 
21 
 

 
 
 
 
 
 
 
 
You can press the 
exit button to exit 
the program 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22 
 

Coding 
Code for Login Button in Login Panel 
if(jTextField1.getText().trim().isEmpty() && jTextField2.getText().trim().isEmpty()){ 
JOptionPane.showMessageDialog(null, "Username and Password cannot be 
empty!"); 

else 
if(jTextField1.getText().trim().isEmpty()){ 
JOptionPane.showMessageDialog(null, "Username cannot be empty!"); 

else 
if(jTextField2.getText().trim().isEmpty()){ 
JOptionPane.showMessageDialog(null, "Password cannot be empty!"); 

else 
try{ 
Class.forName("com.mysql.cj.jdbc.Driver"); 
Connection con = DriverManager.getConnection("jdbc:mysql://localhost/Admin", 
"root", "rnw08564"); 
String sql = "Select * from Admindata where username=? and password=?"; 
PreparedStatement pst = con.prepareStatement(sql); 
pst.setString(1, jTextField1.getText()); 
pst.setString(2, jTextField2.getText()); 
ResultSet rs = pst.executeQuery(); 
if(rs.next()){ 
JOptionPane.showMessageDialog(null, "Username and Password are correct!"); 
NewJFrame menu = new NewJFrame(); 
menu.setVisible(true); 
setVisible(false); 

else{ 
JOptionPane.showMessageDialog(null, "Username and Password are not 
correct!"); 
jTextField1.setText(""); 
jTextField2.setText(""); 


catch(Exception error){ 
JOptionPane.showMessageDialog(null,error);   

23 
 

Code for Cancel Button in Login Panel 


System.exit(0); 
Code for Calculate Button in Grade Calculator 
int T_M=0; 
int P_M=Integer.parseInt(jTextField3.getText()); 
int C_M=Integer.parseInt(jTextField4.getText()); 
int M_M=Integer.parseInt(jTextField5.getText()); 

if(P_M>100 && C_M>100 && M_M>100) 
JOptionPane.showMessageDialog(null, "Invalid entry in all three subjects!"); 
else 
if(P_M>100 && C_M>100) 
JOptionPane.showMessageDialog(null, "Invalid entry in first and second subjects!"); 
else 
if(C_M>100 && M_M>100) 
JOptionPane.showMessageDialog(null, "Invalid entry in second and third subjects!"); 
else 
if(P_M>100 && M_M>100) 
JOptionPane.showMessageDialog(null, "Invalid entry in first and Third subjects!"); 
else 
if(P_M>100) 
JOptionPane.showMessageDialog(null, "Invalid entry of marks in Physics!"); 
else 
if(C_M>100) 
JOptionPane.showMessageDialog(null, "Invalid entry of marks in Chemistry!"); 
else 
if(M_M>100) 
JOptionPane.showMessageDialog(null, "Invalid entry of marks in Mathematics!"); 
else 

T_M=P_M+C_M+M_M; 
jTextField6.setText(""+T_M); 


 
//CODING FOR GRADE CALCULATION 
 
int Percent=T_M/3; 
jTextField7.setText(""+Percent); 
if(Percent>=91) 

jTextField8.setText("A"); 
24 
 

jTextField9.setText("Outstanding"); 

else 
if(Percent<91 && Percent>=81) 

jTextField8.setText("B"); 
jTextField9.setText("Excellent"); 

else 
if(Percent<81 && Percent>=71) 

jTextField8.setText("C"); 
jTextField9.setText("Very Good"); 

else 
if(Percent<71 && Percent>=61) 

jTextField8.setText("D"); 
jTextField9.setText("Good"); 

else 
if(Percent<61 && Percent>=51) 

jTextField8.setText("E"); 
jTextField9.setText("Do Harder Work"); 

else 
if(Percent<51 && Percent>=41) 

jTextField8.setText("E"); 
jTextField9.setText("Poor"); 

else 
if(Percent<33) 

jTextField8.setText("F"); 
jTextField9.setText("Failed"); 

 
 
 
 
25 
 

Code for Clear Button in Grade Calculator 


int ClearOption = JOptionPane.showConfirmDialog(null, "Do you really want to clear 
the data? You cannot undone your action in future.", "Clear Data", 
JOptionPane.YES_NO_OPTION); 
if(ClearOption==0) 

jTextField1.setText(""); 
jTextField2.setText(""); 
jTextField3.setText(""); 
jTextField4.setText(""); 
jTextField5.setText(""); 
jTextField6.setText(""); 
jTextField7.setText(""); 
jTextField8.setText(""); 
jTextField9.setText(""); 
Code for Save Button in Grade Calculator 
String Sdt_N = jTextField1.getText(); 
String R_No = jTextField2.getText(); 
String P_M = jTextField3.getText(); 
String C_M = jTextField4.getText(); 
String M_M = jTextField5.getText(); 
String T_M = jTextField6.getText(); 
String Percent = jTextField7.getText(); 
String Grade = jTextField8.getText(); 
String Remark = jTextField9.getText(); 
try 

Class.forName("java.sql.Driver"); 
String dburl = "jdbc:mysql://localhost/Result"; 
String user = "root"; 
String password = "rnw08564"; 
Connection con = DriverManager.getConnection(dburl,user,password); 
Statement stmt = con.createStatement(); 
String query = "INSERT INTO 
ResultData(Student_Name,Roll_Number,Physics_Marks,Chemistry_Marks,Mathemat
ics_Marks,Total_Marks,Percentage,Grade,Remark)values('"+Sdt_N+"','"+R_No+"','"+P
_M+"','"+C_M+"','"+M_M+"','"+T_M+"','"+Percent+"','"+Grade+"','"+Remark+"')"; 
stmt.executeUpdate(query); 
26 
 

JOptionPane.showMessageDialog(null, "Records Successfully Inserted!"); 


jTextField1.setText(""); 
jTextField2.setText(""); 
jTextField3.setText(""); 
jTextField4.setText(""); 
jTextField5.setText(""); 
jTextField6.setText(""); 
jTextField7.setText(""); 
jTextField8.setText(""); 
jTextField9.setText(""); 

catch(HeadlessException | ClassNotFoundException | SQLException error) 

JOptionPane.showMessageDialog(null, "Error Found!"+error); 

Code for Exit Button in Grade Calculator 
System.exit(0); 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
27 
 

Objective  
This  project  has  been  made  to  store  the  records  of 
students  in  table  like  Student_Name,  Roll_Number, 
Physics_Marks,  Chemistry_Marks,  Mathematics_Marks, 
Total Marks, Percentage, Grade and Remarks. 
Also  to  eliminate  the  paper  work  done  by  the  teachers, 
to  record  every  student’s  details  and  results  in 
computerised  system  so  that  problem  as  record  file 
missing  won’t  be  happen,  to  design  a  user  friendly 
graphical  user  interface  which  suit  the  user  and  to save 
the cost and time. 
Thus  the  project  “Grade  Calculator”  can  be  altered  in 
accordance  with  the  future  requirements  of  the  school 
or organisation. 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
28 
 

Conclusion 
“Grade  Calculator”  has  been  prepared  to  reduce 
manual  work  and  with  help  of  this  application 
programme  the system was able to process and update 
the database with more ease. 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

 
29 
 

Bibliography 
● Sumita Arora Class XII 
● Slideshare.net 
● Wikipedia 
● Google.com 
● Youtube.com 
● Netbeans Forums 
● Cbse.nic.in 
● Sourcecode.in 
 
 
 
 
 
 
 

You might also like