Hostel Management System

87
1

description

Hostel Management Project Report

Transcript of Hostel Management System

Page 1: Hostel Management System

1

Page 2: Hostel Management System

1.1 Abstract

“Hostel Management Information System” should maintain all the

Hostel Student information. The Hostel environment consists of students,

Fee, Room etc so the Hostel Management information system should

maintain details of all students ie., their bio-data ,their personal Information

etc. Fee details like Room rent ,Mess ,Management ,amount etc and also

details like Room to which a particular student belong, their attendance, their

Refund etc.

Therefore it is obvious that system maintains vast amounts of data. In

such cases computerization of the system is inevitable. The ideal reasons for

computerizing Hostel Management system are as follows.

2

Page 3: Hostel Management System

PROJECT DESCRIPTION

This project deals with the Hostel Management System. This project

is having different modules like new Student information creation form ,Fee

information form, Attendance and Room Allotments forms.

This was submitted with One modules given below

1). Login Option:

If the user already contains an account in this system, this form

permit to enter in to this Hotel Management system. Now he can use all the

facilities provided by this Mailing System.

User Menu: Provides a way to give any commands to the Hostel

Management System, the options include in the menu are

1. Student

2. Fee Details

3. Room Allotment

4. Attendance

5. Refunds

6. Reports

7. Exit

1. Student: This screen having option to enter entire details of student and

have an option to save the Details. The fields in this screen are:

Studen ID: It is Uniquely identified by the each student

Stuname: Student Name.

Age: Age of the Student .

Address : Address of the student

Mobile: Mobile number of the student

3

Page 4: Hostel Management System

2). Fee: If the user selects this option on the user menu the corresponding

Fee details of the user will be displayed. To read the different fields, one

option is provided as a save by clicking on the save button .

3) Attendance: Using these options the user can selects Attendance option ,

different student id’s will be available , if u want a particular student id

select one of them from the drop down list and enter corresponding details ,

finally save it by clicking save button.

4) Room Allotment: By clicking this option one more screen will be

displayed on the screen is Room Allotment screen. This screen can be used

to add new details to the database system. Here various listings of room with

the room number and there floor name. Here we have various options.

Save: User to save the details of the student.

Modify: This option is used to update any student room allotment

information.

5) Refund: By selecting options menu one more screen will be displayed,

the screen is Refund amount Screen. This form will contains all information

about balance amount, amount payee by the student and also fine details for

a particular student. It contains following providers

Save: User to save the details of the student.

6)Reports:- By selecting this option menu new screen will be displayed,

the screen will provide option to show details of the All student, student and

fee details reports.

All Student: when we click on this button, it display all the student

details in the Hostel and their personal details..

Student: when we click on this button, it display all the particular

student details based on student id’s.

4

Page 5: Hostel Management System

1.2 ORGANIZATION PROFILE:

Sri Chandrasekharendra Saraswathi Viswa Maha Vidyalaya, Enathur,

Kanchipuram is the brain child of his Holiness Sri Jayendra saraswathi

Swamigal,the sankaracharya of kanchi kamakoti petam. The status of the

university was conferred on this Institution in 1993. Sri Chandrasekharendra

Saraswathi Viswa Maha Vidyalaya University,is being sponsored by Sri

Kanchi Kamakoti Peetam charitable Trust.

The University started functioning for 1994-95 academic years with

very limited resources,but with in a short span of five years,it has equipped

itself adequately to run M.B.A., M.C.A., B.E. programs successfully.The

rapid progress of the University shows the dedication of the employees,

faculties in training the students,active participation of the Authorities and

guidelines and blessing of his Holiness.

A largest library in Asia is in Sri Chandrasekharendra Saraswathi Viswa

Maha Vidyalaya University Library. It is located at Enathur four kms from

the Kanchipuram, South India,is one of the premises University of India

named after the 68th Acharya of Sri Kanchi Kamakoti Peetam,Sri

Chandrasekharendra saraswathi Swamigal whose name is bestowed on the

Maha Vidhyala has cherished a desire ti revive Kanchipuram to its prestige

glory as a center of learning.

5

Page 6: Hostel Management System

6

Page 7: Hostel Management System

1.3 EXISTING SYSTEM

The existing system is a manually maintained system. All the Hostel

Student details are entered into records manually.

Separate records are to be maintained for the details of each student, Fee

details, Room Allocation , Attendance etc. All these details are entered and

retrieved manually.

In such a system, if a particular student’s is to be known, first track the

identification number, then look in for the Room number he is stay in and

based on that check for the Attendance and Refund record or related record.

1.4 Limitations of existing system:

As described earlier the existing manually maintained system is subject to

many errors and disadvantages.The main disadvantages are as follows:

Time Consuming: Retrieval of required data takes much time as the

data is put at several places and one has to browse through many files

to get even a small piece of data. Also the updating process,

preparations of reports manually are all very time consuming.

Inaccuracy: Maintenance of vast data manually has many chances of

inaccuracy of data.

7

Page 8: Hostel Management System

1.5 PROPOSED SYSTEM

The Proposed system is the computerized version of the existing

system. It rectifies most of the pitfalls of the existing system and

maintains databases of all the entities participating in the system.

Computerization provides easy and quick access over the data.

Authorization schemes like giving passwords, encoding data can be used

to maintain data security. Also data cannot be lost due to natural

disasters.

Java has been chosen for this project because Java applications are

portable across a wide range of platforms and operating systems. Java

AWT controls provide tools to develop the package to be efficiently used

by the end users.

8

Page 9: Hostel Management System

9

Page 10: Hostel Management System

2.1 Hardware Requirements

Processor : Pentium

RAM : 512MB

Hard Disk : 4GB

CD Drive : LG

Monitor : LG Monitor

Keyboard : Logitech

2.2 Software Requirements

Language : JAVA

Operating System : Windows XP Professional

Software : JAVA (Swings)

Tool : Command Prompt

Database : Oracle 8.0

10

Page 11: Hostel Management System

SOFTWARE DESCRIPTION

JAVA FEATURE

The inventors of Java wanted to design a language, which would offer

solutions to some of the problems encountered in modern programming.

They wanted the language to be reliable, portable and distributed but also

simple, compact and interactive. Sun Microsystems officially describes Java

with the following attributes:

Compiled and Interpreted

Platform-Independent and Portable

Object-oriented

Robust and Secure

Distributed

Familiar, Simple and Small

Multithreaded and Interactive

High Performance

Dynamic and Extensible

These features have made java the first application language of the World

Wide Web.

Compiled and Interpreted:Usually a computer language is either compiled or interpreted. Java

combines both these approaches thus making Java a two-stage

System. First Java compiler translates the source code into what is

known as the byte code instructions. Byte codes are not machine

instructions and therefore, in the second stage, Java interpreter

11

Page 12: Hostel Management System

generates machine codes that can be directly executed by the machine

that is running the Java program. we can thus say that Java is both a

compiled and interpreted language.

Platform-independent and Portable:-

The most significant contribution of java over other languages is its

portability. Java programs can be easily moved from one computer

system to another, anywhere and anytime. we can download a Java

applet from a remote computer onto out local system via Internet and

execute it locally. Java ensures portability in two ways. First, Java

compiler generates byte code instructions that can be implemented on

any machine. Secondly, the sizes of the primitive data types are

machine-independent.

Simple, Small and Familiar:-

Java is a small and simple language .java does not use pointers,

preprocessor header files, go statements and many others. It also

eliminates operator overloading multiple inheritance. Familiarity is

another striking feature of java. Java is a simplified version of c++.

Multithreaded and Interactive:-

Multithreaded means handling multiple tasks simultaneously. Java

supports multithreaded programs.

12

Page 13: Hostel Management System

This feature greatly improves the interactive performance of graphical

applications.

High Performance:

Java’s performance is impressive for an Interpreted language, mainly

due to the use of intermediate byte code. Java architecture is also

designed to reduce overall overheads during runtime .The

incorporate of multithreaded enhances the overall execution speed of

java programs.

Dynamic and Extensible:

Java is a dynamic language. Java is capable of linking in new class

libraries, methods and objects. Java programs support functions

written in other languages such as c and c++. These functions are

known as native methods.

13

Page 14: Hostel Management System

ABOUT ORACLEData base technology has been described as one of the most rapidly

growing areas of computer and information science. It is know exaggeration

to say that many thousands of organizations have become critically

dependent on the continued and successful operations of a database system.

Overview OF RDBMS

RDBMS is the acronym for Relational Database Management

System. A relational database is an extremely simple way of thinking

about and managing data used in a business. The most famous RDBMS

packages are Oracle , Sybase and Informix.

Introduction to Oracle

Oracle is the most widely used database in the world. It runs on

virtually every kind of computer. Oracle is an object-relational database.

Oracle8 (object Relational Database Management System) offers

capabilities of both relational and object-oriented database systems.

Objects can be defined as reusable software codes, which are location

independent and perform a specific task on any application environment

with little or no change to code.

14

Page 15: Hostel Management System

Oracle products are based on a concept known as the ‘Client/Server

Technology’. This concept involves segregating the processing of an

application between two systems. One performs all activities related to

the database and the other performs activities that help the user to interact

with the application.

The database server or backend is used to manage the database tables

optimally among the multiple clients who concurrently request the server

for the same data. It also enforces data integrity across all the client

applications and controls database access and other security

requirements.

TOOLS FOR ORACLE:

The tools provided by Oracle are so users friendly that a person with

minimum skills in the field of computers can access them with ease. The

main tools are following:

SQL*PLUS

PL/SQL

Forms

Reports

SQL*PLUS

SQL*PLUS is a structured Query Language supported by Oracle. Through

SQL * PLUS we can store, retrieve, edit enter and SQL commands and

15

Page 16: Hostel Management System

PL/SQL blocks. Using SQL * Plus we can perform calculations, list column

definitions for any tale and can also format query result in the form of a

report.

PL/SQL

PL/SQL is an extension of SQL. PL/SQL block can contain any number of

SQL statements integrated with flow of control statements. Thus PL/SQL

combines the data manipulating power of SQL with data processing power

procedural languages.

FORMS

This is a graphical tool used for generating and executing Forms based

application. A form basically comprises blocks and fields. Multiple tables

can be accessed over a single form, based on the application with the help of

transaction commands. Oracle Forms Builder is the design component of

Oracle Forms.

REPORTSIt is an application development tool for Oracle for developing, executing,

displaying and printing reports. We can create a wide variety of reports,

which have various modes.

16

Page 17: Hostel Management System

17

Page 18: Hostel Management System

3.1 Overall System Design Structure

18

Login

Student Information

Fee Details Room Allotment Attendance Refund Reports

Student Info

New Modify Delete

Page 19: Hostel Management System

3.2 DATA FLOW DIAGRAM

Data Flow Diagram graphically represents the flow of data through system and services as a model of system. It identifies the path that data take the processes that cause data and its final destination.

Logical DFD’s are also found to be easier since they show the sequence of transmission or conversation of data by different process of the system.

19

Reports

Student Fee Details Balance

Fee

New Old

Page 20: Hostel Management System

DFD Symbols:

In DFD there are four symbols.

- Terminator defines a source or destination of system data.

- Arrow identifies data-flow data in motion. It is a pipeline through which information flow.

- Circle represents a process that transforms incoming data flows into outgoing data flow(s).

- An open rectangle is a data store.

Use Case Diagrams:-

20

STUDENT INFO

FEE DETAILS

ROOM DETAILS

ATTENDANCE

REPORTS

DATABASE

Page 21: Hostel Management System

UML DIAGRAMS:-

Level :0 Login

Level : 1

Student

Fee Room Refund AttenDance

Level:2

21

Page 22: Hostel Management System

3.4 Database Design:-

Table Name: Student

FIELD

NAME

DATA

TYPE

SIZE CONSTRAINTS DESCRIPTION

Stuid number 10 Primary Key Student ID

Stuname Varchar 15 Not null Student Name

Student

Student id, student name, age, gender,

mobilePublic void StudentPublic void setupPublic void action

Fee

Student id, Total amt, Balance ,date

Public void FeePublic void setupPublic void action

Room

Student id, Room No, Floor Number

Public void RoomPublic void setupPublic void action

Refund

Student id, Total amt, Balance ,fine, datePublic void RefundPublic void setupPublic void action

Attendance

Student id, Total days,Present and absent daysPublic void Attendance

Public void setupPublic void action

22

Page 23: Hostel Management System

Fname Varchar 15 Not null Father Name

Age Number 2 Not null Age

Hostel Varchar 15 Not null Hostel Name

Gender Varchar 6 Not null Gender

Mob Varchar 10 Not null Mobile Number

Dat Date Not null Date of Join

Table Name: Fee

FIELD

NAME

DATA

TYPE

SIZE CONSTRAINTS DESCRIPTION

Stuid Number 10 Foreign Key Student ID

No_mon Number 2 Not null No. of Months

Total_amt Number 7,2 Not null Total Amount

Date_Of_pay Date Not null Date of pay

Amt_pay Number 7,2 Not null Amount Pay

Balance Number 7,2 Not null Balance

Table Name: Room

FIELD

NAME

DATA

TYPE

SIZE CONSTRAINTS DESCRIPTION

Stuid Number 10 Foreign Key Student ID

Course Varchar2 5 Not null Course Name

Room_No Number 2 Not null Room Number

Floor Varchar2 1 Not null Floor Name

23

Page 24: Hostel Management System

Table Name: Attend

FIELD

NAME

DATA

TYPE

SIZE CONSTRAINTS DESCRIPTION

Stuid Number 10 Foreign Key Student ID

Total_days Number 3 Not null Total Days

Present_days Number 3 Not null Present Days

Absent_days Number 3 Not null Absent Days

Table Name: Address

FIELD

NAME

DATA

TYPE

SIZE CONSTRAINTS DESCRIPTION

Stuid Number 10 Foreign Key Student ID

Door_No Varchar2 15 Not null Door No

City Varchar2 10 Not null City

State Varchar2 15 Not null State

Pin code Number 7 Not null Pincode

24

Page 25: Hostel Management System

Hostel Main Form:-

import java.awt.*;import java.awt.event.*;import java.io.*;import javax.swing.*;import javax.swing.event.*;

public class Hostel extends JFrame implements ActionListener{

JButton b1,b2,b3,b4,b5,b6,b7; JLabel l1;

25

Page 26: Hostel Management System

public Hostel() { super("Hostel Management System"); setup(); addWindowListener(new WindowEventHandler()); setVisible(true); } public void setup() { setLayout(null); l1=new JLabel("Hostel Management System"); l1.setFont(new Font("Monotype Corsiva",Font.ITALIC,25)); l1.setBounds(250,100,400,25); l1.setForeground(Color.red); b1=new JButton("Student Info"); b1.setBounds(150,200,150,25); b2=new JButton("Room Allotment"); b2.setBounds(150,250,150,25); b3=new JButton("Fee Details"); b3.setBounds(450,200,150,25); b4=new JButton("EXIT"); b4.setBounds(300,380,150,25); b5=new JButton("Attendance"); b5.setBounds(450,250,150,25); b7=new JButton("Refund"); b7.setBounds(150,300,150,25); b6=new JButton("Reports"); b6.setBounds(450,300,150,25); add(l1);add(b1);add(b2);add(b3);add(b5);add(b4);add(b6);add(b7); setBackground(Color.cyan); setForeground(Color.black); b1.addActionListener(this); b2.addActionListener(this); b3.addActionListener(this); b4.addActionListener(this); b5.addActionListener(this); b6.addActionListener(this); b7.addActionListener(this); setSize(800,600); }

26

Page 27: Hostel Management System

public static void main(String s[]) { Hostel h=new Hostel(); }

public void actionPerformed(ActionEvent ae) { String sst=ae.getActionCommand(); if(sst.equals("Student Info")) { dispose(); Stu st=new Stu(); } else if(sst.equals("Room Allotment")) { dispose(); Room r=new Room(); } else if(sst.equals("Fee Details")) { dispose(); Feedet f=new Feedet(); } else if(sst.equals("Attendance")) { dispose(); Attend a=new Attend(); } else if(sst.equals("EXIT")) { System.exit(0); } else if(sst.equals("Reports")) { dispose(); new Report(); } else if(sst.equals("Refund")) {

27

Page 28: Hostel Management System

dispose(); new Refund(); } }

class WindowEventHandler extends WindowAdapter { public void windowClosing(WindowEvent we) { System.exit(0); } } }

Student Registration Form:-

import java.awt.*;import java.awt.event.*;import java.io.*;import javax.swing.*;import javax.swing.event.*;import java.sql.*;import java.util.*;import java.lang.*;

public class Student extends JFrame implements ActionListener

28

Page 29: Hostel Management System

{JLabel l1,l2,l3,l4,l5,l6,l7,l8,l,l9,l10,ld;JLabel an,as,ast,pin;JTextField t2,t3,t4,t6,t7;JTextField a1,a2,a3;TextArea ta1;JButton b1,b2,b3;Choice ch,ag,ch1,ch2;String mon[]={"Jan","Feb","Mar","Apr","May","Jun","July","Aug","Sep","Oct","Nov","Dec"};

Connection con;Statement st;

public Student(){super("Student Info");setup();addWindowListener(new WindowEventHandler());setVisible(true);}public void setup(){setLayout(null);l1=new JLabel("Student Registration Form");l1.setFont(new Font("Monotype Corsiva",Font.ITALIC,25));l1.setBounds(280,50,200,25); l1.setForeground(Color.red);

setFont(new Font("Courier",Font.BOLD,15));l2=new JLabel("Student ID");l2.setBounds(70,120,100,25);t2=new JTextField();t2.setBounds(240,120,180,25);l3=new JLabel("Student Name");l3.setBounds(70,160,120,25);t3=new JTextField();t3.setBounds(240,160,200,25);l4=new JLabel("Father's Name");

29

Page 30: Hostel Management System

l4.setBounds(70,200,140,25);t4=new JTextField();t4.setBounds(240,200,200,25);l5=new JLabel("Age");l5.setBounds(70,240,160,25);

l6=new JLabel("Address");l6.setBounds(70,280,160,25);

an=new JLabel("House No");an.setBounds(240,300,160,25);a1=new JTextField();a1.setBounds(300,300,100,25);

as=new JLabel("City");as.setBounds(420,300,160,25);a2=new JTextField();a2.setBounds(470,300,100,25);

ast=new JLabel("State");ast.setBounds(240,350,160,25);ch2=new Choice();ch2.setBounds(300,350,100,25);ch2.add("");ch2.add("Andhra Pradesh");ch2.add("TamilNadu");ch2.add("Karnataka");

pin=new JLabel("Pincode");pin.setBounds(420,350,160,25);a3=new JTextField();a3.setBounds(470,350,100,25);

l7=new JLabel("Mobile");l7.setBounds(70,400,160,25);l8=new JLabel("Gender");l8.setBounds(500,240,200,25);t6=new JTextField();t6.setBounds(240,400,200,25);

30

Page 31: Hostel Management System

b1=new JButton("Save");b1.setBounds(200,450,100,25);b2=new JButton("Cancel");b2.setBounds(340,450,100,25);b3=new JButton("Clear");b3.setBounds(480,450,100,25);

l=new JLabel("*");l.setVisible(false);l10=new JLabel("* Invalid Values");l10.setBounds(20,30,200,25);l10.setVisible(false);

ld=new JLabel("Date");ld.setBounds(500,120,100,25);t7=new JTextField();t7.setBounds(550,150,120,25);

ch=new Choice();ch.add("Male");ch.add("Female");ch.setBounds(550,260,100,25);

ag=new Choice();ag.add("");for(int i=0;i<=100;i++) ag.add(""+i);ag.setBounds(240,240,70,25);

l9=new JLabel("Hostel Name");l9.setBounds(500,180,100,25);ch1=new Choice();ch1.add("");ch1.add("Vishalakhshi");ch1.add("Annapoorni");ch1.setBounds(550,210,150,25);

Calendar cal=Calendar.getInstance();

31

Page 32: Hostel Management System

String dat=cal.get(Calendar.DATE)+"/"+mon[cal.get(Calendar.MONTH)]+"/"+cal.get(Calendar.YEAR);t7.setText(""+dat);t7.setEditable(false);

add(l);add(l1);add(l2);add(l3);add(l4);add(l5);add(l6);add(t2);add(t4);add(t3);add(l7);add(t6);add(an);add(a1);add(as);add(a2);add(ast);add(a3);add(pin);add(ch2);add(b1);add(b2);add(l8);add(ch);add(ag);add(l10);add(ch1);add(l9);add(t7);add(b3);add(ld);b1.addActionListener(this);b2.addActionListener(this);b3.addActionListener(this);setBackground(Color.cyan);setSize(800,600);}

public void actionPerformed(ActionEvent ae){ String sst=ae.getActionCommand(); if(sst.equals("Save")) { String id=t2.getText(); String nam=t3.getText(); String fname=t4.getText(); String age=ag.getSelectedItem(); String hname=ch1.getSelectedItem(); String gender=ch.getSelectedItem(); String mob=t6.getText(); //Double a=Double.parseDouble(id); String da=t7.getText(); String no=a1.getText(); String str=a2.getText(); String pin=a3.getText(); String sta=ch2.getSelectedItem();

if(id.length()==0){

32

Page 33: Hostel Management System

JOptionPane.showMessageDialog(null,"invlaid ID");} else if(nam.length()==0){ JOptionPane.showMessageDialog(null,"invlaid Student name number");} else if(fname.length()==0){ JOptionPane.showMessageDialog(null,"invlaid Father name");} else if(age.length()==0){ JOptionPane.showMessageDialog(null,"invlaid age");} else if(hname.length()==0){ JOptionPane.showMessageDialog(null,"invlaid hostel name");} else if(gender.length()==0){ JOptionPane.showMessageDialog(null,"invlaid gender");} else if(no.length()==0){ JOptionPane.showMessageDialog(null,"invlaid Door number");} else if(str.length()==0){ JOptionPane.showMessageDialog(null,"invlaid city");} else if(sta.length()==0){ JOptionPane.showMessageDialog(null,"invlaid State");} else if(pin.length()==0){ JOptionPane.showMessageDialog(null,"invlaid pincode");} else if(pin.length()!=6){ JOptionPane.showMessageDialog(null,"pincode havaing 6 numbers");} else if(mob.length()!=10){ JOptionPane.showMessageDialog(null,"invlaid Mobile number");} else { int n=0; if(n==0) { try { int an=Integer.parseInt(id); n=1; }

catch(Exception e) { JOptionPane.showMessageDialog(null,"Enter numbers only in ID"); } }

33

Page 34: Hostel Management System

if(n==1) { try { Long an=Long.parseLong(mob); n=2; }

catch(Exception e) { JOptionPane.showMessageDialog(null,"Enter numbers only in Mobile field"); } } if(n==2) {

int len=nam.length(); char s[]=nam.toCharArray(); for(int i=0;i<len;i++) { if(Character.isDigit(s[i])) { JOptionPane.showMessageDialog(null,"Enter text only in name field"); i=len; n=2; } else n=3; } } if(n==3) {

int le=fname.length(); char s[]=fname.toCharArray(); for(int i=0;i<le;i++) { if(Character.isDigit(s[i])) {

34

Page 35: Hostel Management System

JOptionPane.showMessageDialog(null,"Enter text only father name field"); i=le; n=3; } else n=4; } } if(n==4) {

try { int an=Integer.parseInt(pin); n=5; }

catch(Exception e) { JOptionPane.showMessageDialog(null,"Enter numbers only pincode"); } } if(n==5) { try

{Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

con=DriverManager.getConnection("jdbc:odbc:Hostel","ramesh","rams");st=con.createStatement();st.executeUpdate("insert into student

values("+id+",'"+nam+"','"+fname+"',"+age+",'"+hname+"','"+gender+"',"+mob+",'"+da+"')"); st.executeUpdate("insert into address values("+id+",'"+no+"','"+str+"','"+sta+"',"+pin+")");

JOptionPane.showMessageDialog(null," Record insert sucessfully"); con.close();

st.close();dispose();

35

Page 36: Hostel Management System

new Hostel();}

catch(Exception e){System.out.println("SqlException Caught:"+e);

JOptionPane.showMessageDialog(null," sql Error is occured");}

} } }

else if(sst.equals("Cancel")) { dispose(); Stu st=new Stu(); } else if(sst.equals("Clear")) { t2.setText(""); t3.setText(""); t4.setText(""); t6.setText(""); a1.setText(""); a2.setText(""); a3.setText(""); }}public static void main(String s[]){ Student stt=new Student();}

class WindowEventHandler extends WindowAdapter{public void windowClosing(WindowEvent we){ dispose(); new Hostel();

36

Page 37: Hostel Management System

}}

}

Fee Information Form:-

import java.awt.*;import java.awt.event.*;import java.io.*;import javax.swing.*;import javax.swing.event.*;import java.util.*;import java.sql.*;

public class Fee extends JFrame implements ActionListener,FocusListener{JLabel l1,l2,l3,l4,l5,l6,l7,l8,l9,l10,ld;JTextField t2,t3,t4,t5,t6,t7,t8,t9,t10,td;JTextArea ta1;JButton b1,b2,b3;Choice ch;String mon[]={"Jan","Feb","Mar","Apr","May","Jun","July","Aug","Sep","Oct","Nov","Dec"};Choice ch2,ch1;Connection con;Statement st;ResultSet rs;

public Fee(){super("Fee Information");setup();addWindowListener(new WindowEventHandler());setVisible(true);}public void setup(){

37

Page 38: Hostel Management System

setLayout(null);l1=new JLabel("Fee Information");l1.setFont(new Font("Monotype Corsiva",Font.ITALIC,25));l1.setBounds(250,50,400,25); l1.setForeground(Color.red);

setFont(new Font("Courier",Font.BOLD,15));l2=new JLabel("Student ID");l2.setBounds(70,120,100,25);/*t2=new JTextField();t2.setBounds(240,120,180,25);*/ch2=new Choice();ch2.setBounds(240,120,180,25);ch2.add("");

l3=new JLabel("Room Rent");l3.setBounds(70,160,100,25);t3=new JTextField();t3.setBounds(240,160,60,25);t3.setText("9000");t3.setEditable(false);

l4=new JLabel("Mess");l4.setBounds(360,160,60,25);t4=new JTextField();t4.setBounds(430,160,60,25);t4.setText("6000");t4.setEditable(false);

l5=new JLabel("Hostel Management");l5.setBounds(70,200,160,25);t5=new JTextField();t5.setBounds(240,200,60,25);t5.setText("2000");t5.setEditable(false);

l6=new JLabel("No of Months");l6.setBounds(360,200,100,25);t6=new JTextField();

38

Page 39: Hostel Management System

t6.setBounds(520,200,40,25);

l10=new JLabel("Others");l10.setBounds(70,240,100,25);t10=new JTextField();t10.setBounds(240,240,60,25);t10.setText("9000");t10.setEditable(false);

l7=new JLabel("Total Amount");l7.setBounds(70,280,120,25);t7=new JTextField();t7.setBounds(240,280,80,25);

l8=new JLabel("Amount Pay");l8.setBounds(70,330,120,25);t8=new JTextField();t8.setBounds(240,330,80,25);

l9=new JLabel("Balance");l9.setBounds(360,320,80,25);t9=new JTextField();t9.setBounds(450,320,80,25);

ld=new JLabel("Date");ld.setBounds(500,120,100,25);td=new JTextField();td.setBounds(550,120,120,25);

Calendar cal=Calendar.getInstance();String dat=cal.get(Calendar.DATE)+"/"+mon[cal.get(Calendar.MONTH)]+"/"+cal.get(Calendar.YEAR);td.setText(""+dat);

b1=new JButton("Save");b1.setBounds(200,450,100,25);b2=new JButton("Cancel");

39

Page 40: Hostel Management System

b2.setBounds(340,450,100,25);b3=new JButton("Clear");b3.setBounds(480,450,100,25);

add(l1);add(l2);add(l3);add(l4);add(l5);add(l6);add(l7);add(l9);add(l8);add(l10);add(ch2);add(t3);add(t4);add(t5);add(t10);add(t6);add(t7);add(t9);add(t8);add(b1);add(b2);add(b3);add(ld);add(td);td.setEditable(false);t8.addFocusListener(this);t6.addFocusListener(this);b1.addActionListener(this);b2.addActionListener(this);b3.addActionListener(this);setBackground(Color.cyan);setSize(800,600);try{ Class.forName("sun.jdbc.odbc.JdbcOdbcDriver"); con=DriverManager.getConnection("jdbc:odbc:Hostel","ramesh","rams"); st=con.createStatement(); rs=st.executeQuery("select stuid from student"); while(rs.next()) { int a=rs.getInt(1); ch2.add(""+a); }}catch(Exception e){ System.out.println(e); JOptionPane.showMessageDialog(null,"Sql error occured");}

}

public void focusLost(FocusEvent f){ if(f.getSource()==t8)

40

Page 41: Hostel Management System

{ int b=Integer.parseInt(t7.getText())-Integer.parseInt(t8.getText()); t9.setText(""+b); } else if(f.getSource()==t6) { int res=Integer.parseInt(t3.getText())+Integer.parseInt(t4.getText())+Integer.parseInt(t5.getText())+Integer.parseInt(t10.getText()); int mon=Integer.parseInt(t6.getText()); res=(res*mon)/6; t7.setText(""+res); }}public void focusGained(FocusEvent fe){ }

public void actionPerformed(ActionEvent ae){ String sst=ae.getActionCommand(); if(sst.equals("Save")) { String id=ch2.getSelectedItem(); String mon=t6.getText(); String total=t7.getText(); String pay=t8.getText(); String bal=t9.getText(); String dat=td.getText();

if(id.length()==0){ JOptionPane.showMessageDialog(null,"invlaid ID");} else if(mon.length()==0){ JOptionPane.showMessageDialog(null,"invlaid Months");} else if(pay.length()==0){ JOptionPane.showMessageDialog(null,"invlaid amount pay");} else {

41

Page 42: Hostel Management System

int n=0; if(n==0) { try { int an=Integer.parseInt(mon); n=1; }

catch(Exception e) { JOptionPane.showMessageDialog(null,"Enter numbers only in month field"); } } if(n==1) { try { int an=Integer.parseInt(pay); n=2; }

catch(Exception e) { JOptionPane.showMessageDialog(null,"Enter numbers only in Paying amt"); } } if(n==2) { try

{Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

con=DriverManager.getConnection("jdbc:odbc:Hostel","ramesh","rams");st=con.createStatement();st.executeUpdate("insert into fee

values("+id+","+mon+","+total+",'"+dat+"',"+pay+","+bal+")");JOptionPane.showMessageDialog(null," Record insert sucessfully");

con.close();st.close();

42

Page 43: Hostel Management System

dispose(); new Hostel();

} catch(Exception e)

{System.out.println("SqlException Caught:"+e);

JOptionPane.showMessageDialog(null," sql Error is occured: "+e);}

} } } else if(sst.equals("Cancel")) { dispose(); new Hostel(); } else if(sst.equals("Clear")) { t6.setText(""); t7.setText(""); t8.setText(""); t9.setText(""); ch.select(0); }}

public static void main(String s[]){ Fee f=new Fee();}

class WindowEventHandler extends WindowAdapter{public void windowClosing(WindowEvent we){System.exit(0);}} }

43

Page 44: Hostel Management System

44

Page 45: Hostel Management System

45

Page 46: Hostel Management System

Login Form

46

Page 47: Hostel Management System

Hostel Main Form

47

Page 48: Hostel Management System

Student Information form

48

Page 49: Hostel Management System

Student Registration Form

49

Page 50: Hostel Management System

Student Updating Form

50

Page 51: Hostel Management System

Student Deletion Form

51

Page 52: Hostel Management System

Fee Information Form

52

Page 53: Hostel Management System

Student Installment Pay form

53

Page 54: Hostel Management System

Room Allotment Form

54

Page 55: Hostel Management System

Student Attendance Form

55

Page 56: Hostel Management System

Refund Amount Form

56

Page 57: Hostel Management System

57

Page 58: Hostel Management System

Student Report

58

Page 59: Hostel Management System

Student Fee Report

59

Page 60: Hostel Management System

Student Information Report

60

Page 61: Hostel Management System

4.1 METHODOLOGY USED FOR TESTING

System testing is aimed at ensuring that the system works accurately and

efficiently before live operation commences. The system should be test data,

61

Page 62: Hostel Management System

specifically designed to show that the system will operate successfully in all

aspects and produce expected result under expected condition. The system tests

data and the results of processing are maintained throughout the operational life of

the system for audit purpose or test any subsequent amendments.

System testing is a critical element of software quality assurance and

represents the ultimate review of specifications, design and coding. Testing is a

process of executing program with the intention of finding error. A good test is

one, which has a high probability of finding undiscovered errors. In other words,

possible aim of testing is to find faults in the software.

Module Testing

Module testing is a process of testing the system module by module, what

are all the input given and what are all the output produced and whether they are

required by testing in this method.

We would be very clear of the bugs occurred. The project matrimonial is

tested module wise.

Unit Testing

In this testing we test each module individually and integrate with the

overall system. Unit testing focuses verification efforts on the smallest unit

software design in the module. This is also known as module testing is carried out

during programming stage itself. The fields are validated for perfect working of

the project. In this step each module is found to working satisfactorily as regard to

the expected output from the module. There are some validation checks for fields

also. For example validation is done for verifying the data input given by the user,

which both the formats and validating of the data entered. It is very easy to find

error and debug the system.

Integrated Testing

62

Page 63: Hostel Management System

Data can be lost across an interface one module can have an adverse effort

on the other sub functions, when combined, may not produce the desired major

functions. Integration testing is the systematic testing for constructing the uncover

errors within the interface. The testing was done with sample data. The developed

system has run successfully for this sample data. The need for integrated is to find

the over all system performance.

Validation Testing

At the culmination of the block box testing, software is completely

assembled as a package, interfacing errors have been uncovered and corrected and

a final series of software tests that is validation tests begins validation testing can

be defined in many ways but a simple definition is that validation succeeds when

the software functions in a manner that can be reasonably expected be the

customer the project is validated.

4.2 SYSTEM IMPLEMENTATION

63

Page 64: Hostel Management System

Implementation is one of the most important tasks in project development.

Implementation is the phase, in which one has to be cautious because all the

errors undertaken during the project will be fruitful only if the software is

properly implemented according to the plans made.

The implementation phase is less creative than system design. It is

primarily concerned with user training site preparation and file conversion. This

project can be implemented in efficient and user-friendly manner by using the

controls.

For description, Label Boxes are used.

In order to get inputs, Text Boxes are used.

Drop down List Boxes are used for selecting one input from multiple

choices.

Command buttons are used to perform necessary action.

Data controls are used where ever necessary.

A data Grid, which is one of the feature’s of Java, is used to prepare

reports.

JDBC is used in order to connect database and queries.

Depending on the nature of the system, extensive user training may be required.

Programming itself is a design work. The initial parameters of the Management

Kit should be modified as a result of programming efforts; programming provides

a reality test from the assumptions made by the analyst.

The major elements of the implementation plans are as follows:

Test plans

64

Page 65: Hostel Management System

Training plans

Equipment Installation plans

Conversation of Installation plans

Conversation plans

65

Page 66: Hostel Management System

5. CONCLUSION

The project titled as "Hostel Management Information System " been designed with much care, with the intention easier and the more complexity involved is presented in a simple and lucid style.

66

Page 67: Hostel Management System

The Hostel Management System works in a similar fashion as that of an Hotel Management System. The various Department student information is to be stored and retrieve any time when required.

67

Page 68: Hostel Management System

7. BIBLIOGRAPHY

68

Page 69: Hostel Management System

References:

Java Network Programming 2nd Edition – Merlin Hughes,Michael Shoffner, Derek Hamner – http://nitric.com/jnp/ -- Network Specific Java Programming

Thinking in Java 2nd Edition – BruceEckel – http://www.BruceEckel.com – Java Programming

Java 2 Black Book – Steven Holzner – Swing

Sun's Java Tutorial -- http://java.sun.com/docs/books/tutorial – Swing and Updated Methods

Complete reference java 2 - TATA McGraw HILL

Websites:

http://www.BruceEckel.com – Java Programming http://nitric.com/jnp/ -- Network Specific Java Programminghttp://java.sun.com/docs/books/tutorial – Swing and Updated Methods

69