Você está na página 1de 26

PROJECT REPORT

11/2011

STUDENT MANAGEMENT SYSTEM

Students: Phm c Dng Nguyn Trung Kin Batch Code: Centre: SE01

NIIT- ANZ

Project Report

NIIT-ANZ

PROJECT ON

Page 2 of 26

Project Report

NIIT-ANZ

Developed by

Name: Phm c Dng Nguyn Trung Kin

STUDENT MANAGEMENT SYSTEM

Page 3 of 26

Project Report

NIIT-ANZ

Batch Code Start Date

SE01
End Date: 30-11-2011

: 25-11-2011

Names of Developers

: Phm

c Dng, Nguyn Trung Kin

Date of Submission: 30-11-2011

Page 4 of 26

Project Report

NIIT-ANZ

CERTIFICATE
This is to certify that this report titled Student Management Student. Embodies the original work done by Pham Duc Dung, Nguyen Trung Kien in partial fulfillment of their course requirement at NIIT.

Coordinator: Nguyen Xuan Viet

Page 5 of 26

Project Report

NIIT-ANZ

ACKNOWLEDGEMENT
We have benefited a lot from the feedback and suggestions given by teacher Nguyen Xuan Viet and friends in my class.

Page 6 of 26

Project Report

NIIT-ANZ

INTRODUCTION
BACKGROUND

Brilliant Careers was established twenty years ago in New York by Norman Bates and is one of the best engineering institutes of the country. When the institute was established, it started with two streams, Electronics & Telecommunications and Electrical & Electronics. As the technology became advanced and the students achieved excellent results, many other streams were also introduced, such as Computer Science, Information Technology, and Electronics & Instrumentation. This resulted in rapid increase in the number of students getting themselves enrolled to various new streams being offered by the institute. Envisioned System The institute is planning to computerize the tasks related to its student management. You have been asked to implement this new computerized sytem in the institute. You need to use shell scripting to create Student Management software as the computers In the institute run on the Linux operating sytem. The followng task-list has been given to you in order to computerize the existing system: Create four files, FirstSem, SecondSem, ThirdSem, FourthSem to store the and semested-wise record of all students. Whenever a new student joins the institute, open the respective semester file and record the following details about the student: Student_ID (Generated automatically) Frist_Name Last_Name Stream ID (CS/IT/ET/EE/EI/ME/CE) Phone State Note: The format for all semester files in same. The delimiter, colon (:), is used as field separator in all the files. Whenever a student leaves the institute, delete his/her from the reapective file. Whenever a student details in changed, make appropriate changes in the repective student file. Implement the following search operations: Search any student detail based on the Student_ID Search records of the students who live in same city (City wise) Search records stream wise and semester wise
Page 7 of 26

Project Report

NIIT-ANZ

Search records of the students who live in same State (State wise) Generate the following reports for the technical department: Stream wise and semester wise report of the student Stream wise report of all the students from all semesters

Page 8 of 26

Project Report

NIIT-ANZ

ACTIVITIES LIST
The following tasks have been performed to meet the specifications of the project scenario: 1) Create a script file as main.sh. This file contains the code to display the main menu.
2) Create a script file as add_stu.sh. This file contains the code to add records

in file created to store the student record.


3) Create a script file as delete_stu.sh. This file contains the code to delete

records to store the student record records in file created to store the hostel record.
4) Create a script file as edit.sh. This file contains the code to modify records to

store the student record.


5) Create a script file as search.sh. This file contains the code to search records

to store the student record.


6) Create a script file as report.sh. This file contains the code to view report

information student.

Page 9 of 26

Project Report

NIIT-ANZ

ARCHITECTURE DIAGAM

MAIN.SH

student.sh hostel1.sh print.sh report.sh user_group main.sh

Page 10 of 26

Project Report

NIIT-ANZ

ARCHITECTURE DIAGAM

STUDENT.SH

Edit First Name

Edit Last Name Edit Date of Enrollment

Edit StreamID

student.sh Edit Add Delete Search

Edit Phone

Edit City

Edit State

Edit Zip Code ID

Stream

City

State

Page 11 of 26

Project Report

NIIT-ANZ

ARCHITECTURE DIAGAM HOSTEL.SH

Student Name Edit Fathers Name Edit Room Number

Edit Stream Code

hostel.sh Edit Add Delete Search

Edit Semester Code Edit Address Edit Phone Edit Character Grade Edit Room Partners Name

Room Number

Stream

Semester

Address

Page 12 of 26

Project Report

NIIT-ANZ

ARCHITECTURE DIAGAM

USER_GROUP.SH

user_group.sh Add User Add Group

Page 13 of 26

Project Report

NIIT-ANZ

CODE
#!/bin/bash tput clear opt=0 while [ $opt != 6 ] do

FOR THE MAIN.SH

echo "#################STUDENT MANAGEMENT SYSTEM ######################" echo "# ============================================================== #" echo " 1. Add new Student" echo " 2. Delete Student" echo " 3. Edit Student" echo " 4. Search Student" echo " 5. Report" echo " 6. Exit" echo "===================================================================" echo "###################################################################" echo -e " Enter Choice: \c" read opt case $opt in 1) . add_stu.sh;; 2) . delete_stu.sh;; 3) . edit.sh;; 4) . search.sh;; 5) . report.sh;; 6) exit;; *) echo "Invaid Input" echo "Press <Enter> continue..." read;; esac

done

Page 14 of 26

Project Report

NIIT-ANZ

CODE

FOR THE ADD_STU.SH

clear echo echo " ==== STUDENT MANAGEMENT SYSTEM ====" echo echo " Student Information" echo "========================================" st_ID=`cat student.txt | cut -d: -f1|tail -1` echo " Student ID: `expr $st_ID + 1`" l=0 echo -n " First Name: " read fname while test "$fname" == "" do echo "First name not null" echo "Please re enter: " read fname if test "$fname" != "" then break fi done echo -n " Last Name: " read lname while test "$lname" == "" do echo "Last name not null" echo "Please re enter: " read lname if test "$lname" != "" then break fi done echo " Date of Enrollment: `date +%d`/`date +%m`/`date +%Y`" date="`date +%d`/`date +%m`/`date +%Y`" echo -n " Stream ID (CS, IT, EE, ET, EI, ME, CE): " read str_ID ######bat loi nhap khong dung ID n=0 for st_ID in CS IT EE ET EI ME CE do if [ "$st_ID" != "$str_ID" ] then n=`expr $n + 1` fi done while test $n = 7 do echo "**Stream ID is invalid**" echo "**Stream ID is CS, IT, EE, ET, EI, ME, CE.**" echo " Please reenter: " read str_ID n=0 for st_ID in CS IT EE ET EI ME CE do if [ "$st_ID" != "$str_ID" ]
Page 15 of 26

Project Report
then n=`expr $n + 1` fi done if [ $n = 6 ] then break fi done ######## echo -n " State: " read state while test "$state" == "" do echo "State not null" echo "Please re enter: " read state if test "$state" != "" then break fi done echo -n " City: " read city while test "$city" == "" do echo "City not null" echo "Please re enter: " read city if test "$city" != "" then break fi done echo -n " Address: " read add while test "$add" == "" do echo "Address not null" echo "Please re enter: " read add if test "$add" != "" then break fi done echo -n " Contact Number: " read cnum echo "========================================"

NIIT-ANZ

if test ! -f Students.txt then sd_ID=1 touch Students.txt else sd_ID=`tail -1 Students.txt | cut -d: -f1` sd_ID=`expr $sd_ID + 1` fi if [ $l = 0 ] then echo $sd_ID:$fname:$lname:$date:$str_ID:$city:$state:$add:$cnum >>
Page 16 of 26

Project Report
Students.txt echo " Join success!" echo echo " 1.Add new student." echo " 2.Return main menu." echo " 3.Exit" echo -n " Enter your choice: " read ch case $ch in "1") bash add_stu.sh;; "2") bash Main.sh;; "3") exit;; *) echo -e "\n\t Invalid input!\c" echo -e "\n\t\t Press <Enter> key to continue...\c" read;; esac fi clear

NIIT-ANZ

Page 17 of 26

Project Report

NIIT-ANZ

CODE

FOR THE

DELETE_STU.SH

clear echo echo " ==== STRUDENT MANAGEMENT SYSTEM ====" echo echo " Delete Student Information " echo "======================================" echo touch poolfile echo -n " Enter Student ID you want delete: " read sd_ID exist_ID=`cat Students.txt | cut -d: -f1 | grep "$sd_ID"` if [ "$exist_ID" == "" ] then echo " Cannot find Student ID!" else echo -n " Do you want delete record with student id $sd_ID (Y/N) : " read quest cat Students.txt | while read line do pass=`echo "$line" | cut -d: -f1` if [ "$pass" != "$sd_ID" ] then echo $line>>poolfile else if [ "$quest" == "N" -o "$quest" == "n" ] then echo $line>>poolfile elif [ "$quest" == "Y" -o "$quest" == "y" ] then break fi fi done cat poolfile>Students.txt echo "Done" fi rm poolfile echo "======================================" echo " Option" bash option

Page 18 of 26

Project Report

NIIT-ANZ

CODE
#!/bin/bash tput clear timkiem() { opt=0 while [ $opt != 6 ] do

FOR THE

SEARCH.SH

echo "#######################SEARCH STUDENT#############################" echo "# ============================================================== #" echo " 1. Search Student ID" echo " 2. Search Stream ID" echo " 3. Search City" echo " 4. Search State" echo " 5. Back Menu Main" echo " 6. Exit" echo "===================================================================" echo "###################################################################" echo -e " Enter Choice: \c" read opt case $opt in 1) search_student;; 2) search_stream;; 3) search_city;; 4) search_state;; 5) . main.sh;; 6) exit;; *) echo "Invaid Input" echo "Press <Enter> continue..." read;; esac done } search_student() { echo -e "Please enter your student ID in the database : \c" read IDSua TimThay=`cat Students.txt |cut -d: -f1|grep "^$IDSua"` if [ "$IDSua" != "$TimThay" ] then echo "student ID you entered is not in the database" . search.sh else kq1=`cat Students.txt |grep "^$TimThay"` echo "Enter your student ID found: $TimThay" echo "Student ID:First name:Last name:Date of Enrollment:Stream ID:City:State:Address:Contact Number(Phone)" echo "$kq1" exit fi }
Page 19 of 26

Project Report

NIIT-ANZ

search_stream() { echo "========================================" echo "Stream ID only allowed to enter values: " echo "CS: Computer Science" echo "IT: Information Technology" echo "ET: Electronics & Telecommunications" echo "EE: Electrical & Electronics" echo "EI: Electronics & Instrumentation" echo "ME: Mechanical" echo "CE: Civil Engineering" echo "========================================" echo -e "Enter Stream ID new: \c" read streame while test "$streame" != "CS" -a "$streame" != "IT" -a "$streame" != "ET" -a "$streame" != "EE" -a "$streame" != "EI" -a "$streame" != "ME" -a "$streame" != "CE" do echo "The value entered is not valid, the above test conditions!" echo -e "Please re-enter your StreameID: \c" read streame done echo -e "Please enter your Stream ID in the database : \c" TimThay=`cat Students.txt |cut -d: -f5|grep "^$streame"` streamIDcu=`cat Students.txt |grep "^$TimThay"` while test "$TimThay" == "" do echo "Stream ID you entered is not in the database" echo -e "Please re-enter your Student ID:" read streame TimThay=`cat Students.txt | cut -d: -f5 | grep "$streame"` if test "$TimThay" != "" then break fi done echo "Enter your student ID found: $TimThay" echo "Student ID:First name:Last name:Date of Enrollment:Stream ID:City:State:Address:Contact Number(Phone)" echo "$streamIDcu" } search_city() { echo -e "Please enter your City in the database : \c" read city TimThay=`cat Students.txt |cut -d: -f7|grep "^$city"` if [ "$city" != "$TimThay" ] then echo "City you entered is not in the database" . search.sh else fname=`cat Students.txt |grep "^$city"|cut -d: -f2|head -1` lname=`cat Students.txt |grep "^$city"|cut -d: -f3|head -1` kq=`cat Students.txt |grep "^$city"|cut -d: -f7|head -1` echo "Enter your Stream ID found: $TimThay" echo "First name:Last name:City" echo "$fname:$flname:$kq" exit fi
Page 20 of 26

Project Report
} search_state() {

NIIT-ANZ

echo -e "Please enter your State in the database : \c" read IDSua TimThay=`cat Students.txt |cut -d: -f6|grep "^$IDSua"` if [ "$IDSua" != "$TimThay" ] then echo "State you entered is not in the database" . search.sh else kq=`cat Students.txt |grep "^$TimThay"` echo "Enter your Stream ID found: $TimThay" echo "Student ID:First name:Last name:Date of Enrollment:Stream ID:City:State:Address:Contact Number(Phone)" echo "$kq" exit fi } timkiem

Page 21 of 26

Project Report

NIIT-ANZ

CODE

FOR THE REPORT.SH

report() { echo echo -e " Moi nhap vao ID cua sinh vien: \c" read id thongtin=`grep ^$id danhsachsv.txt` echo $thongtin>filetam2 fname=`cut -d: -f2 filetam2` lname=`cut -d: -f3 filetam2` date=`cut -d: -f4 filetam2` stream=`cut -d: -f5 filetam2` phone=`cut -d: -f6 filetam2` city=`cut -d: -f7 filetam2` echo echo " echo echo " echo " echo " echo " echo " echo " echo " read } report STUDENT INFORMATION" StudentID: "$id First Name: "$fname Last Name: "$lname Date of Enrollment: "$date StreamID: "$stream Phone: "$phone Address: "$city

Page 22 of 26

Project Report

NIIT-ANZ

CODE

FOR THE PRINT.SH

Page 23 of 26

Project Report

NIIT-ANZ

EXECUTE

THE

APPLICATION

To execute the Sutudent Management System shell script application: 1. Log on as root user. 2. Create a directory, project, under your home directory, and copy all the Student Managament System related shell Script to the directory, project. 3. Issue the following command to change the permission of the shell scripts such that the user ha execute permission on them:
chmod 774 ~/project/*.sh

4. Log out and log on again as the root user. 5. Issue the following command at the shell prompt to execute the Student Management System shell script application:
. main.sh

Page 24 of 26

Project Report

NIIT-ANZ

SYSTEM CONFIGURATION
Hardware: PC compatible with a Intel Atom processor, 256-MB RAM, and 20GB of Hard disk.

Operating system: Fedore Core 6 opetaring system

Page 25 of 26

Project Report

NIIT-ANZ

PROJECT FILE DETAILS


S.No File Name Description

main.sh

Contains the code to display the main menu. Contains the code to add records in file created to store the student record.

create.sh

delete.sh

Contains the code to delete records in file created to store the hostel record. Contains the code to modify records in file created to store the hostel record. Contains the code to search records in file created to store the hostel record. Contains the code to view report information student.

edit.sh

search.sh

report.sh

Page 26 of 26

Você também pode gostar