Anda di halaman 1dari 56

1.

INTRODUCTION

1.1 About Project:


The security of the data is provided through authenticated users, one can view
and update the data upto their access permissions only. The information regarding to tasks is
provided through syntaxes and sample programs about that lab.
Faculty is able to post and update marks of students. All the users of automation of lab
tasks can give and view the feedback and faculty is able to provide notices related to tasks,
like date of task submission, dates of lab examinations. The students are provided
permissions to view the notices only. Once the student logged into the lab automatically
his/her attendance marks will be posted.
Administrator maintains database and solves if any technical problems occurred by
using technologies like servlets, jsps using tomcat server and can retrieve the data from
database using oracle 10g.

2. PROJECT ANALYSIS

2.1 Purpose of the project:


Automation of lab tasks minimizes the difficulties in maintaining the students
database .Report genartion by faculty is performed easily by faculty.A very brief guidance is
provided through syntaxes and sample programms to the students. Security is provided to the
records by only allowing authenticated users to access the system.

2.2 Existing system:


1) Faculty maintains the students data manually in task evolution sheet.
2) The time duration of report generation is high, because of the operations on
student data are performed manually by the faculty.
3) More guidance should be provided by faculty to the students about the specific
task, if they have not that much of knowledge about that task, so that they cant
utilize the practice session completely
4) The security to the task evolution sheet is low, so that unauthorized will be able to
view and update the marks.

Problems in exisiting system:


The time duration of report generation is high, because of the operations on
student data are performed manually by the faculty. More guidance should be provided by
faculty to the students about the specific task, if they have not that much of knowledge about
that task, so that they cant utilize the practice session completely
The security to the task evolution sheet is low, so that unauthorized will be able
to view and update the marks.

2.3 Proposed system:


1)
2)
3)
4)

Administrator maintains the database dynamically.


Report generation is performed easily.
Complete information regarding to the lab tasks is provided.
Complete overview of the all lab tasks is provided through sample programs and
syntaxes.
5) Whenever the students logged into the systems, his/her attendance marks are
posted automatically.
6) Users like students, Head of Department; faculty can view and give the
FEEDBACK.
7) Logins are provided to the faculty, students, and admin. Users can view and
update data up to their access permissions only, so that security can be guaranteed.

3. REQUIREMENT ANALYSIS
3.1 Purpose And Scope:
Purpose:providing security to all records
Scope: 1) providing access to only authenticated users .
2) Know updated notices,
3) View marks posted.
4) View all data related to lab tasks.

3.2 Users Of The System:


Student.
Faculty .
Administrator.
Students: He is a main users to utilizes the services of our system.He/she is guided through
sample programs and syntaxes by our system.Students are able to give their feedback and
view latest

Faculty :Report generation is performed by faculty .He/she is able to maintain the database
dynamically.He/she will give notices and latest updates regarding the labs.He/she gives
guidance to students.
Admin is to maintain the database and to solve any technical problems if occurs.

4. SPECIFIC REQUIREMENTS
4.1 User Interface Requirements:
Professional look and feel
Use of AJAX at least with all registration forms
Browser testing and support for IE, NN, Mozilla, and Fire fox.
Reports exportable in .XLS, or any other desirable format.

4.2 a) Functional Requirements:


1)
2)
3)
4)
5)
6)
7)

Complete information regarding lab tasks should be provided.


Only Authenticated users can view and update the data.
Administrator maintains the database.
Notices and feedback should be provided by authenticated users.
Report generation should be performed dynamically.
Provide logins to the student, faculty, and administrator.
Students can view the data up to their access permissions only.

b) Non Functional Requirements:


1)
2)
3)
4)

Secure access of confidential data SSL can be used.


24*7 availability.
Better component design to get better performance at peak time.
Flexible service based architecture will be highly desirable for future
extension.

5. PROPOSED SYSTEM ARCHITECTURE

Marks

Student

Syntaxes

Tasks

Home2 page

Discussion
forum
Login page

Faculty

marks

Notices

Registration
page

Discussion forum
Administrator

Admin page

6. SYSTEM REQUIREMENTS
5

6.1Technologies Used:
a ) HTML
b) Servlets
c) Jsps
d) Xml
e) java Script

6.2 Tools used:


a)
b)
c)
d)

Oracle10g.
Rational Rose98 Enterprise Edition.
Eclipse3.3.
Tomcat5.5.

7. SYSTEM DESIGN
7.1 Dataflow Diagrams
Assi
gn

7.1.1 E-R Diagram

ha
s

Contr
ol

Admin

Faculty

Student
marks

fid

vie
w

Student

Ha
s

Ha
s

Ha
s

Semister
RollN
O

FID

RollNO

LabId

bid

TaskI
d

FirsstNa
me

Observati
on Marks

LastN
ame

Firstnam
e
LastName

Record
marks

Address

Attenda
nce
marks

phoneNo

Passwor
d

Designat
ion

Batch

Executio
n

Address

year

7.2 Behavioral Diagrams


7.2.1

Usecase Diagram:

7.2.2 Class Diagram

Student
Name : type = varchar
password : type = varchar
year : type = varchar
batch : type = initval
semister : type = int
Address : type = varchar
login()
view tasks()
Give feedback()
post question()
view solution()
view Notices()
view syntaxes()
view sample programs()
download textbooks()
logout()

*..1

Administrator
Name : type = Varchar
Designation : type = vardhar
password : type = varchar
login()
maintains database()
logout()

*..1

Faculty
name : type = varchar
password : type = varchar
designation : type = varchar
Addres : type = varchar
login()
post marks()
post question()
view solution()
give notices()
update marks()
logout()

7.2.3 Sequence Diagrams:


Faculty Login:

Faculty

System

Database

Enter the details


verifies with DB
user exists
Displays loggedin successfully
otherwise

displays register first

10

Student Login
Student

System

Database

Enter the details


verifies with DB
user exists
Displays loggedin successfully
otherwise

displays register first

Admin Login:
Admin

System

Database

Enter the details


verifies with DB
user exists
Displays loggedin successfully
otherwise

displays register first

11

View notices:
Student

System

Database

Requst for Notices


verifies with DB
Exists
Displays noticees
otherwise

Must be entered faculty

View feedback:
Faculty

System

Database

Requst for Feedback


verifies with DB
Exists
Dispalys feedback

otherwise

Must be entered student

12

Post Marks:
Faculty

System

Insert weekly marks

Databse

Stores in the database

marks inserted successfully

Update Marks:
Faculty

System

update weekly marks

Databse

Stores in the database

marks updated successfully

13

Administrator

Databse
Maintains the database
Solves technical problems

Admin works:

View Tasks:

Student

System

Requests for Syntaxes


Displays Syntaxes

14

View Syntaxes:
Student

System

Requests for tasks


Displays tasks

Discussion Forum:

User

System

Post question

Database

Stores in the databse

Displays question posted sucessfully

15

7.2.4 Collaboration Diagrams:


Student Registration:
2: Stores in the databas e
Sys tem

Databas
e

1: 3:
Enter
Dis plays
the details
s uccess fully regis tered

Student

Faculty Registration:
1: Enter the details
Faculty

Sys tem

3: Dis plays s ucces s fully regis tered

2: Stores in the databas e

Databas
e

16

Admin Registration:
1: Enter the details
Adm inis tr
ator

Sys tem

3: Dis plays s ucces s fully regis tered

2: Stores in the databas e

Databas
e

Faculty Login:
1: Enter the details
System

Faculty
4: Displays successfully logged in
6: Need to be registered
3: user exists
5: otherwise

2: verifies with the database

Databas
e

17

StudentLogin:

1: Enter the details


Student

System
4: Dispalys loggedin
6: Must be registerd
3: Exists
5: otherwise

2: verifies with DB

Databas
e

AdminLogin:
1: Enter the details
Admin

System
4: Dispalys loggedin
6: Must be registerd
3: Exists
5: otherwise

2: verifies with DB

Databas
e

18

View notices:
1: Request for Notices
Student

System
4: Displays notices
6: Need to be entered by Faculty
3: if they exists
5: otherwise
2: verifies with the database

Databas
e

View Feedback:
1: Request for feedback
System

Faculty
4: Displays Feedback
6: Need to be entered by Student

3: if feedback exists
5: otherwise
2: verifies with the database

Databas
e

19

PostMarks:

1: Ins ert weekly m arks


Faculty

Sys tem

3: m arks ins erted succes s fully

2: Stores in the database

Databs e

UpdateMarks:
1: update weekly m arks
Faculty

Sys tem

3: m arks updated succes s fully

2: Stores in the database

Databs e

20

Admin works
1: Maintains the database
2: Solves technical problems
Administr
ator

Databse

Viewsyntaxes:
1: Requests for Syntaxes
Student

System
2: Displays Syntaxes

Discussion forum:
1: Post question
System

User

3: Displays question posted sucessfully

2: Stores in the databse

Databas
e

21

7.2.5 Activity diagrams


Registrations of users;

22

Login verification:

23

Request for notices:

24

Request for feedback:

25

Report generation

26

View Marks

27

8. SNAP SHOTS
Home Page:

Login Page:

28

Student Home Page:

29

Admin

Students Marks:

30

Student weekly Marks:

Discussion Forum:

31

Best Performer:

Text Books:

32

Tasks:

Syntaxes:

33

Notices:

9. SAMPLE CODE
34

Code for Login


package suri; //package name
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
/* Servlet implementation class for Servlet: */
public class Log extends javax.servlet.http.HttpServlet implements
javax.servlet.Servlet { //class Log
static final long serialVersionUID = 1L;
/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#HttpServlet()
*/
public Log() {
super();
}
/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#doGet(HttpServletRequest request,
HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse
response) throws ServletException, IOException {
// TODO Auto-generated method stub
doPost(request,response);
}
/* (non-Java-doc)
* @see javax.servlet.http.HttpServlet#doPost(HttpServletRequest request,
HttpServletResponse response)
*/
35

protected void doPost(HttpServletRequest request, HttpServletResponse


response) throws ServletException, IOException {
int statuss=0;
Connection con = null;
RequestDispatcher rd=null;
String status = "false";
HttpSession sess=request.getSession();
String name=request.getParameter("Name");
System.out.println("form"+name);
String pass=request.getParameter("Password");
String type=request.getParameter("rb");
System.out.println(type);
int i=0;
PrintWriter pw=response.getWriter();// print writer object
try {
String url = "jdbc:mysql://localhost:3
String db = "labdatabase";
String driver = "com.mysql.jdbc.Driver";
String user = "root";
String passd = "suri";
Class.forName(driver).newInstance();
con = DriverManager.getConnection(url+db, user, passd); // data
base connection
ResultSet rs=null;
PreparedStatement pst=null;
pst=con.prepareStatement("select * from login"); //get data from
table login
rs=pst.executeQuery();
while(rs.next()){
if(name.equals(rs.getString("UserId"))&&pass.equals(rs.getString("Password")))//veri
fies with the database values
i=1;
break;
}
}
if(i==1)
{
pst=con.prepareStatement("select Role from Login where
UserId='"+name+"' and Password='"+pass+"'");//prepared statement
rs=pst.executeQuery();
36

rs.next();
String status2=rs.getString(1);
if(status2.equals("Student")){
rd=request.getRequestDispatcher("icons1.html");//goes to
student home page
rd.forward(request,response);
}
else if(status2.equals("Faculty")){
rd=request.getRequestDispatcher("s.html"); //goes
to faculty home page
rd.forward(request,response);
}
else if(status2.equals("Admin")){
rd=request.getRequestDispatcher("icons1.html"); //goes to admin home page
rd.forward(request,response);
}
}
} catch (InstantiationException e) {
// catch exceptions
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}

37

10. TEST CASES


Test case no: 1 Module: Registration
SNO

TESTCASE
NAME

INPUT

EXPECTED
OUTPUT

Userid values

Manikantha

If length of Userid
Invalid
userid less than value
8 it is valid
entered is
greater than
8
If length of Userid
Valid
userid less than value is a
8 it is valid
valid one

Sairam

ACTUAL
OUTPUT

VALID/INVALID

Test case no: 2 Module: Authentication


SNO TESTCASE
NAME
1

INPUT

Userid and Manikantha


password
5345
values

Sairam
520

Faculty login

Userid:Faculty
name
Password:fac

EXPECTED
OUTPUT

ACTUAL
OUTPUT

VALID/INVALID

If length of userid
less than 8 it is
valid
And the userid
and
password
values
in
database
table
should match
If length of userid
less than 8 it is
valid
And the userid
and
password
values
in
database
table
should match
Userid
and
Faculty
values
should
match
with
facultys
userid
and
password

Userid
Invalid
value
entered is
greater
than 8

Userid
Valid
value and
password
is a valid
one

Invalid
Invalid
userid or
password
again
control is
back
to
login page
Userid:Faculty
Userid and admin Valid ones Valid
Password:Faculty values
should so control
match
goes dmin
38

withuid&pasword page

11. LITERATURE REVIEW


LAB TASKS:
1 ) C LANGUAGE:
Week l.
a) Write a C program to find the sum of individual digits of a positive integer.
b) A Fibonacci Sequence is defined as follows: the first and second terms in the sequence are
0 and 1.
Subsequent terms are found by adding the preceding two terms in the sequence. Write a C
program to
generate the first n terms of the sequence.
c) Write a C program to generate all the prime numbers between 1 and n, where n is a value
supplied by
the user.
Week 2.
a) Write a C program to calculate the following Sum:
Sum=1-x2/2! +x4/4!-x6/6!+x8/8!-x10/10!
b) Write a C program toe find the roots of a quadratic equation.
Week 3
a) Write C programs that use both recursive and non-recursive functions
i) To find the factorial of a given integer.
ii) To find the GCD (greatest common divisor) of two given integers.
iii) To solve Towers of Hanoi problem.
Week 4
a) The total distance travelled by vehicle in t seconds is given by distance = ut+1/2at2
where u and a
are the initial velocity (m/sec.) and acceleration (m/sec2). Write C program to find the
distance travelled at
regular intervals of time given the values of u and a. The program should provide the
flexibility to the
user to select his own time intervals and repeat the calculations for different values of u and
a.
b) Write a C program, which takes two integer operands and one operator form the user,
performs the
operation and then prints the result. (Consider the operators +,-,*, /, % and use Switch
Statement)
Week 5
a) Write a C program to find both the larges and smallest number in a list of integers.
b) Write a C program that uses functions to perform the following:
i) Addition of Two Matrices
ii) Multiplication of Two Matrices
Week 6
a) Write a C program that uses functions to perform the following operations:
39

i) To insert a sub-string in to given main string from a given position.


ii) To delete n Characters from a given position in a given string.
b) Write a C program to determine if the given string is a palindrome or not
Week 7
a) Write a C program that displays the position or index in the string S where the string T
begins, or 1 if
S doesnt contain T.
b) Write a C program to count the lines, words and characters in a given text.
Week 8
a) Write a C program to generate Pascals triangle.
b) Write a C program to construct a pyramid of numbers.
Week 9
Write a C program to read in two numbers, x and n, and then compute the sum of this
geometric
progression:
1+x+x2+x3+.+xn
For example: if n is 3 and x is 5, then the program computes 1+5+25+125.
Print x, n, the sum
Perform error checking. For example, the formula does not make sense for negative
exponents if n is
less than 0. Have your program print an error message if n<0, then go back and read in the
next pair of
numbers of without computing the sum. Are any values of x also illegal ? If so, test for them
too.
Week 10
a) 2s complement of a number is obtained by scanning it from right to left and
complementing all the bits
after the first appearance of a 1. Thus 2s complement of 11100 is 00100. Write a C program
to find the
2s complement of a binary number.
b) Write a C program to convert a Roman numeral to its decimal equivalent.
Week 11
Write a C program that uses functions to perform the following operations:
i) Reading a complex number
ii) Writing a complex number
iii) Addition of two complex numbers
iv) Multiplication of two complex numbers
(Note: represent complex number using a structure.)
Week 12
a) Write a C program which copies one file to another.
b) Write a C program to reverse the first n characters in a file.
(Note: The file name and n are specified on the command line.)
Week 13
Write a C program that uses functions to perform the following operations on singly linked
list.:
i) Creation ii) Insertion iii) Deletion iv) Traversal
Week 14

40

Write a C program that uses functions to perform the following operations on doubly linked
list.:
i) Creation ii) Insertion iii) Deletion iv) Traversal in both ways
Week 15
Write C programs that implement stack (its operations) using
i) Arrays ii) Pointers
Week 16
Write C programs that implement Queue (its operations) using
i) Arrays ii) Pointers
Week 17
Write a C program that uses Stack operations to perform the following:
i) Converting infix expression into postfix expression
ii) Evaluating the postfix expression
Week 18
Write a C program that uses functions to perform the following:
i) Creating a Binary Tree of integers
ii) Traversing the above binary tree in preorder, inorder and postorder.
Week 19
Write C programs that use both recursive and non recursive functions to perform the
following searching
operations for a Key value in a given list of integers :
i) Linear search ii) Binary search
Week 20
Write C programs that implement the following sorting methods to sort a given list of
integers in ascending
order:
i) Bubble sort ii) Quick sort
Week 21
Write C programs that implement the following sorting methods to sort a given list of
integers in ascending
order:
i) Insertion sort ii) Merge sort
Week 22
Write C programs to implement the Lagrange interpolation and Newton- Gregory forward
interpolation.
Week 23
Write C programs to implement the linear regression and polynomial regression algorithms.
Week 24
Write C programs to implement Trapezoidal and Simpson methods.
2) JAVA:
Week1 :
a) Write a Java program that prints all real solutions to the quadratic equation ax2 + bx + c =
0. Read in a,
b, c and use the quadratic formula. If the discriminant b2 -4ac is negative, display a message
stating that
41

there are no real solutions.


b) The Fibonacci sequence is defined by the following rule:
The fist two values in the sequence are 1 and 1. Every subsequent value is the sum of the two
values
preceding it. Write a Java program that uses both recursive and non recursive functions to
print the nth
value in the Fibonacci sequence.
Week 2 :
a) Write a Java program that prompts the user for an integer and then prints out all prime
numbers up to
that integer.
b) Write a Java program to multiply two given matrices.
c) Write a Java Program that reads a line of integers, and then displays each integer, and the
sum of all
the integers (Use StringTokenizer class of java.util)
Week 3 :
a) Write a Java program that checks whether a given string is a palindrome or not. Ex:
MADAM is a
palindrome.
b) Write a Java program for sorting a given list of names in ascending order.
c) Write a Java program to make frequency count of words in a given text.
Week 4 :
a) Write a Java program that reads a file name from the user, then displays information about
whether the
file exists, whether the file is readable, whether the file is writable, the type of file and the
length of the file
in bytes.
b) Write a Java program that reads a file and displays the file on the screen, with a line
number before
each line.
c) Write a Java program that displays the number of characters, lines and words in a text file.
Week 5 :
a) Write a Java program that:
i) Implements stack ADT.
ii) Converts infix expression into Postfix form
iii) Evaluates the postfix expression
Week 6 :
a) Develop an applet that displays a simple message.
b) Develop an applet that receives an integer in one text field, and computes its factorial
Value and
returns it in another text field, when the button named Compute is clicked.
Week 7 :
Write a Java program that works as a simple calculator. Use a grid layout to arrange buttons
for the digits
and for the +, -,*, % operations. Add a text field to display the result.
Week 8 :
a) Write a Java program for handling mouse events.
Week 9 :

42

a) Write a Java program that creates three threads. First thread displays Good Morning
every one
second, the second thread displays Hello every two seconds and the third thread displays
Welcome
every three seconds.
b) Write a Java program that correctly implements producer consumer problem using the
concept of inter
thread communication.
Week 10 :
Write a program that creates a user interface to perform integer divisions. The user enters two
numbers in
the textfields, Num1 and Num2. The division of Num1 and Num2 is displayed in the Result
field when the
Divide button is clicked. If Num1 or Num2 were not an integer, the program would throw a
NumberFormatException. If Num2 were Zero, the program would throw an
ArithmeticException Display
the exception in a message dialog box.
Week 11 :
Write a Java program that implements a simple client/server application. The client sends
data to a server.
The server receives the data, uses it to produce a result, and then sends the result back to the
client. The
client displays the result on the console. For ex: The data sent from the client is the radius of
a circle, and
the result produced by the server is the area of the circle. (Use java.net)
Week 12 :
a) Write a java program that simulates a traffic light. The program lets the user select one of
three lights:
red, yellow, or green. When a radio button is selected, the light is turned on, and only one
light can be on
at a time No light is on when the program starts.
b) Write a Java program that allows the user to draw lines, rectangles and ovals.
Week 13 :
a) Write a java program to create an abstract class named Shape that contains an empty
method named
numberOfSides ( ).Provide three classes named Trapezoid, Triangle and Hexagon such that
each one of
the classes extends the class Shape. Each one of the classes contains only the method
numberOfSides
( ) that shows the number of sides in the given geometrical figures.
b) Suppose that a table named Table.txt is stored in a text file. The first line in the file is the
header, and
the remaining lines correspond to rows in the table. The elements are 49eparated by commas.
Write a
java program to display the table using Jtable component.
3) CPP

43

Week1 :
C++ programs to implement the following using an array.
a) Stack ADT b) Queue ADT
Week2 :
Write C++ programs to implement the following using a singly linked list.
a) Stack ADT b) Queue ADT
Week3 :
Write C++ programs to implement the deque (double ended queue) ADT using a doubly
linked list and an
array.
Week 4 :
Write a C++ program to perform the following operations:
a) Insert an element into a binary search tree.
b) Delete an element from a binary search tree.
c) Search for a key element in a binary search tree.
Week5 :
.Write C++ programs that use non-recursive functions to traverse the given
binary tree in
a) Preorder b) inorder and c) postorder.
Week6 :
Write C++ programs for the implementation of bfs and dfs for a given graph.
Week7 :
Write C++ programs for implementing the following sorting methods:
a) Merge sort b) Heap sort
Week8 :
Write a C++ program to perform the following operations
a) Insertion into a B-tree b) Deletion from a B-tree
Week9 :
.Write a C++ program to perform the following operations
a) Insertion into an AVL-tree b) Deletion from an AVL-tree
Week10 :
Write a C++ program to implement all the functions of a dictionary (ADT)
using hashing.
Week11 :
Write a C++ program for implementing Knuth-Morris- Pratt pattern matching
algorithm.
Week12 :
Write a C++ program for implementing Boyer Moore Patten matching
algorithm
4) UNIX
Week1
Session-1
a)Log into the system
b)Use vi editor to create a file called myfile.txt which contains some
text.
c)correct typing errors during creation.
d)Save the file
44

e)logout of the system


Session-2
a)Log into the system
b)open the file created in session 1
c)Add some text
d)Change some text
e)Delete some text
f)Save the Changes
g)Logout of the system
Week2
a)Log into the system
b)Use the cat command to create a file containing the following data. Call it mytable use tabs
to separate
the fields.
1425 Ravi 15.65
4320 Ramu 26.27
6830 Sita 36.15
1450 Raju 21.86
c)Use the cat command to display the file, mytable.
d)Use the vi command to correct any errors in the file, mytable.
e)Use the sort command to sort the file mytable according to the first field. Call the sorted file
my table
(same name)
f)Print the file mytable
g)Use the cut and paste commands to swap fields 2 and 3 of mytable. Call it my table (same
name)
h)Print the new file, mytable
i)Logout of the system.
Week3
1) a)Login to the system
b)Use the appropriate command to determine your login shell
c)Use the /etc/passwd file to verify the result of step b.
d)Use the who command and redirect the result to a file called myfile1. Use the more
command
to see the contents of myfile1.
e)Use the date and who commands in sequence (in one line) such that the output of date will
display on the screen and the output of who will be redirected to a file called myfile2. Use the
more command to check the contents of myfile2.
2) a)Write a sed command that deletes the first character in each line in a
file.
b)Write a sed command that deletes the character before the last character in each line in a
file.
c)Write a sed command that swaps the first and second words in each line in a file.
Week4
a)Pipe your /etc/passwd file to awk, and print out the home directory of each user.
b)Develop an interactive grep script that asks for a word and a file name and then tells how
many lines
contain that word.
c)Repeat
d)Part using awk
45

Week5
a)Write a shell script that takes a command line argument and reports on whether it is
directory, a file, or
something else.
b)Write a shell script that accepts one or more file name as arguments and converts all of
them to
uppercase, provided they exist in the current directory.
c)Write a shell script that determines the period for which a specified user is working on the
system.
Week6
a)Write a shell script that accepts a file name starting and ending line numbers as arguments
and displays
all the lines between the given line numbers.
b)Write a shell script that deletes all lines containing a specified word in one or more files
supplied as
arguments to it.
Week7
a)Write a shell script that computes the gross salary of a employee according to the following
rules:
i)If basic salary is < 1500 then HRA =10% of the basic and DA =90% of the basic.
ii)If basic salary is >=1500 then HRA =Rs500 and DA=98% of the basic
The basic salary is entered interactively through the key board.
b)Write a shell script that accepts two integers as its arguments and computers the value of
first number
raised to the power of the second number.
Week8
a)Write an interactive file-handling shell program. Let it offer the user the choice of copying,
removing,
renaming, or linking files. Once the user has made a choice, have the program ask the user for
the
necessary information, such as the file name, new name and so on.
b)Write shell script that takes a login name as command line argument and reports when
that person
logs in
c)Write a shell script which receives two file names as arguments. It should check whether
the two file
contents are same or not. If they are same then second file should be deleted.
Week9
a)Write a shell script that displays a list of all the files in the current directory to which the
user has read,
write and execute permissions.
b)Develop an interactive script that ask for a word and a file name and then tells how many
times that
word occurred in the file.
c)Write a shell script to perform the following string operations:
i)To extract a sub-string from a given string.
ii)To find the length of a given string.
Week10
Write a C program that takes one or more file or directory names as command line input and
reports the
46

following information on the file:


i)File type
ii)Number of links
iii)Read, write and execute permissions
iv)Time of last access
(Note : Use stat/fstat system calls)
Week11
Write C programs that simulate the following unix commands:
a)mv
b)cp
(Use system calls)
Week12
Write a C program that simulates ls Command
(Use system calls / directory API)
5) WEBTECHNOLOGIES
Design the following static web pages required for an online book store web site.
1) HOME PAGE:
The static home page must contain three frames.
Top frame : Logo and the college name and links to Home page, Login page, Registration
page,
Catalogue page and Cart page (the description of these pages will be given below).
Left frame : At least four links for navigation, which will display the catalogue of respective
links.
For e.g.: When you click the link CSE the catalogue for CSE Books should be
displayed in the Right frame.
Right frame: The pages to the links in the left frame must be loaded here. Initially this page
contains
description of the web site.
Logo
Web Site Name
Home Login Registration Catalogue Cart
CSE
ECE
EEE
CIVIL
Description of the Web Site
Fig 1.1
2) LOGIN PAGE:
This page looks like below:
Logo
Web Site Name
Home Login Registration Catalogue Cart
CSE
ECE
EEE
CIVIL
Login :
47

Password:
3) CATALOUGE PAGE:
The catalogue page should contain the details of all the books available in the web site in a
table.
The details should contain the following:
1. Snap shot of Cover Page.
2. Author Name.
3. Publisher.
4. Price.
5. Add to cart button.
Logo
Web Site Name
Home Login Registration Catalogue Cart
CSE
ECE
EEE
CIVIL
Book : XML Bible
Author : Winston
Publication : Wiely
$ 40.5
Book : AI
Author : S.Russel
Publication : Princeton
hall
$ 63
Book : Java 2
Author : Watson
Publication : BPB
publications
$ 35.5
Book : HTML in 24 hours
Author : Sam Peter
Publication : Sam
publication
$ 50
Note: Week 2 contains the remaining pages and their description.
Week-2:
4) CART PAGE:
Submit Reset
The cart page contains the details about the books which are added to the cart.
The cart page should look like this:
Logo
Web Site Name
Home Login Registration Catalogue Cart
CSE
ECE
EEE
CIVIL
48

Book name Price Quantity Amount


Java 2 $35.5 2 $70
XML bible $40.5 1 $40.5
Total amount - $130.5
5) REGISTRATION PAGE:
Create a registration form with the following fields
1) Name (Text field)
2) Password (password field)
3) E-mail id (text field)
4) Phone number (text field)
5) Sex (radio button)
6) Date of birth (3 select boxes)
7) Languages known (check boxes English, Telugu, Hindi, Tamil)
8) Address (text area)
WEEK 3:
VALIDATION:
Write JavaScript to validate the following fields of the above registration page.
1. Name (Name should contains alphabets and the length should not be less than 6
characters).
2. Password (Password should not be less than 6 characters length).
3. E-mail id (should not contain any invalid and must follow the standard pattern
name@domain.com)
4. Phone number (Phone number should contain 10 digits only).
Note : You can also validate the login page with these parameters.
Week-4:
Design a web page using CSS (Cascading Style Sheets) which includes the following:
1) Use different font, styles:
In the style definition you define how each selector should work (font, color etc.).
Then, in the body of your pages, you refer to these selectors to activate the styles.
<HEAD>
2) Set a background image for both the page and single elements on the page.
You can define the background image for the page like this:
3) Control the repetition of the image with the background-repeat property.
As background-repeat: repeat
Tiles the image until the entire page is filled, just like an ordinary background image in
plain HTML.
4) Define styles for links as
A:link
A:visited
A:active
A:hover
Example:
<style type="text/css">
A:link {text-decoration: none}
A:visited {text-decoration: none}
A:active {text-decoration: none}
A:hover {text-decoration: underline; color: red;}
</style>
5) Work with layers:
49

For example:
LAYER 1 ON TOP:
<div style="position:relative; font-size:50px; z-index:2;">LAYER 1</div>
<div style="position:relative; top:-50; left:5; color:red; font-size:80px; zindex:
1">LAYER 2</div>
LAYER 2 ON TOP:
<div style="position:relative; font-size:50px; z-index:3;">LAYER 1</div>
<div style="position:relative; top:-50; left:5; color:red; font-size:80px; zindex:
4">LAYER 2</div>
6) Add a customized cursor:
Selector {cursor:value}
Week-5:
Write an XML file which will display the Book information which includes the following:
1) Title of the book
2) Author Name
3) ISBN number
4) Publisher name
5) Edition
6) Price
Write a Document Type Definition (DTD) to validate the above XML file.
Display the XML file as follows.
The contents should be displayed in a table. The header of the table should be in color GREY.
And the
Author names column should be displayed in one color and should be capitalized and in bold.
Use your
own colors for remaining columns.
Use XML schemas XSL and CSS for the above purpose.
Note: Give at least for 4 books. It should be valid syntactically.
Hint: You can use some xml editors like XML-spy
Week-6:
VISUAL BEANS:
Create a simple visual bean with a area filled with a color.
The shape of the area depends on the property shape. If it is set to true then the shape of the
area is
Square and it is Circle, if it is false.
The color of the area should be changed dynamically for every mouse click. The color should
also be
changed if we change the color in the property window .
Week-7:
1) Install TOMCAT web server and APACHE.
While installation assign port number 4040 to TOMCAT and 8080 to APACHE. Make sure
that these ports are available i.e., no other process is using this port.
2) Access the above developed static web pages for books web site, using these servers by
putting the web pages developed in week-1 and week-2 in the document root.
Access the pages by using the urls : http://localhost:4040/rama/books.html (for tomcat)
http://localhost:8080/books.html (for Apache)
Week-8:
User Authentication :
Assume four users user1,user2,user3 and user4 having the passwords pwd1,pwd2,pwd3
and pwd4 respectively. Write a servelet for doing the following.
50

1. Create a Cookie and add these four user ids and passwords to this Cookie.
2. Read the user id and passwords entered in the Login form (week1) and authenticate
with the values (user id and passwords ) available in the cookies.
If he is a valid user(i.e., user-name and password match) you should welcome him by
name(user-name) else you should display You are not an authenticated user .
Use init-parameters to do this. Store the user-names and passwords in the webinf.xml and
access them in the servlet by using the getInitParameters() method.
Week-9:
Install a database(Mysql or Oracle).
Create a table which should contain at least the following fields: name, password, email-id,
phone number(these should hold the data from the registration form).
Practice 'JDBC' connectivity.
Write a java program/servlet/JSP to connect to that database and extract data from the
tables and display them. Experiment with various SQL queries.
Insert the details of the users who register with the web site, whenever a new user clicks the
submit button in the registration page (week2).
Week-10:
Write a JSP which does the following job:
Insert the details of the 3 or 4 users who register with the web site (week9) by using
registration
form. Authenticate the user when he submits the login form using the user name and
password
from the database ( similar to week8 instead of cookies).
Week-11:
Create tables in the database which contain the details of items (books in our case like Book
name , Price, Quantity, Amount )) of each category. Modify your catalogue page (week 2)in
such
a way that you should connect to the database and extract data from the tables and display
them
in the catalogue page using JDBC.
Week-12:
HTTP is a stateless protocol. Session is required to maintain the state.
The user may add some items to cart from the catalog page. He can check the cart page for
the
selected items. He may visit the catalogue again and select some more items. Here our
interest
is the selected items should be added to the old cart rather than a new cart. Multiple users can
do the same thing at a time(i.e., from different systems in the LAN using the ip-address
instead of
localhost). This can be achieved through the use of sessions. Every user will have his own
session which will be created after his successful login to the website. When the user logs out
his
session should get invalidated (by using the method session.invalidate() ).
Modify your catalogue and cart JSP pages to achieve the above mentioned functionality using
sessions.

51

12. APPENDIX

12.1 Appendix A - Hardware and Software Configurations

Software requirements
Operating system

:windows XP/linux

Programming language :JAVA


Beverside script

:Jsp,servlets

Clientside script

:HTML,javascript

IDE

:eclipse

Webserver

:Tomcat

Hardware Requirements
Processor

:Pentium IV

RAM

:512mb

Harddisk

:40 GB

52

12.2 Appendix B Data Base Tables


Login
usreid

Password

Role

Faculty
Fid

FirstName

LastName

Address

PhoneNo

Password

Designation

Student:
RollNo

FirstName

LastName

Address

Year

Password

Semister

Notices
Noticesid NoticesDescription FacultyId

LabId

Semister

Questions
QuestionId Quedstion

Administrator:
Fid

semester

Labid

Bid

Student Marks:
RollNo

TaskId

Observation Record
53

Attendance Execution

Batch

solutions
QuestionId Quedstion

12.3. Appendix C-Limitations and Enhancements


Limitations:

The main limitation in Automation of labtasks is allowing only authenticated


users to use the services.

Enhancements:

Lab exams question paper would automatically be generated.

All tasks and syntaxes can automatically generated.

54

13. REFERENCES
Books:

The complete Reference Java2 By Patrick Naughton and Herbert Schildt, TMH
Publishing Company Ltd.

Java How To Program By H.M.Dietel and P.J.Dietel,Pearson Education/PHI

Data Base Management Systems,Raghurama Krishnan, Johannes Gerhrke,TATA


McGraw-Hill

Software Engineering By Roger S.Pressman,McGraw Hill International Edition


Pressman

Websites:
www.tgmc.in
www.ibm.com
www.cgisecurity.com

55

56

Anda mungkin juga menyukai