CHALAPATHI INSTITUTE OF ENGINEERING & TECHNOLOGY lab manual/cs362.pdf · CHALAPATHI NAGAR, LAM,...
Transcript of CHALAPATHI INSTITUTE OF ENGINEERING & TECHNOLOGY lab manual/cs362.pdf · CHALAPATHI NAGAR, LAM,...
1
CHALAPATHI INSTITUTE OF ENGINEERING & TECHNOLOGY CHALAPATHI NAGAR, LAM, GUNTUR-522034
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
Vision of the Institute
To emerge as an Institute of Excellence for Engineering and Technology and provide world-class
education and research opportunities to the students catering the needs of society.
Mission of the Institute
Establishing a state-of-the-art Engineering Institute with continuously improving infrastructure
and produce students with innovative skills and global outlook.
Department Vision To produce professionally competent, research oriented and socially sensitive engineers and technocrats in the emerging technologies. Department Mission DM 1: State of art laboratories to meet the needs of the continuous change. DM2: Provide a research environment to meet the societal issues. DM3: Facilitating collaborations/MOU’S towards emerging technologies.
2
CHALAPATHI INSTITUTE OF ENGINEERING & TECHNOLOGY CHALAPATHI NAGAR, LAM, GUNTUR-522034
DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
PEOs: PEO1: Graduates shall excel in computer industry profession or higher studies through quality education.
PEO2: Graduates shall analyse real life problems, design computing systems appropriate to its solutions by exhibiting professionalism and team work. PEO3: Graduates shall demonstrate their ability to a rapidly changing environment by engaging in lifelong learning.
POs :
1. ENGINEERING KNOWLEDGE: Apply the knowledge of mathematics, science, engineering fundamentals, and an engineering specialization to the solution of complex engineering problems.
2. PROBLEM ANALYSIS: Identify, formulate, research literature, and analyze complex engineering problems reaching substantiated conclusions using first principles of mathematics, natural sciences, and engineering sciences.
3. DESIGN/DEVELOPMENT OF SOLUTIONS: Design solutions for complex engineering problems and design system components or processes that meet the specified needs with appropriate consideration for the public health and safety, and the cultural, societal, and environmental considerations.
4. CONDUCT INVESTIGATIONS OF COMPLEX PROBLEMS: Use research-based knowledge and research methods including design of experiments, analysis and interpretation of data, and synthesis of the information to provide valid conclusions.
5. MODERN TOOL USAGE: Create, select, and apply appropriate techniques, resources, and modern engineering and IT tools including prediction and modelling to complex engineering activities with an understanding of the limitations.
3
6. THE ENGINEER AND SOCIETY: Apply reasoning informed by the contextual knowledge to assess societal, health, safety, legal and cultural issues and the consequent responsibilities relevant to the professional engineering practice.
7. ENVIRONMENT AND SUSTAINABILITY: Understand the impact of the professional engineering solutions in societal and environmental contexts, and demonstrate the knowledge of, and need for sustainable development.
8. ETHICS: Apply ethical principles and commit to professional ethics and responsibilities and norms of the engineering practice.
9. INDIVIDUAL AND TEAM WORK: Function effectively as an individual, and as a member or leader in diverse teams, and in multidisciplinary settings.
10. COMMUNICATION: Communicate effectively on complex engineering activities with the engineering community and with society at large, such as, being able to comprehend and write effective reports and design documentation, make effective presentations, give and receive clear instructions.
11. PROJECT MANAGEMENT AND FINANCE: Demonstrate knowledge and understanding of the engineering and management principles and apply these to one’s own work, as a member and leader in a team, to manage projects and in multidisciplinary environments.
12. LIFE-LONG LEARNING: Recognize the need for, and have the preparation and ability to engage in independent and life-long learning in the broadest context of technological change.
PROGRAM SPECIFIC OUTCOMES (PSOs):
A graduate of the Computer Science and Engineering Program will demonstrate:
PSO1: Professional Skills: The ability to understand, analyze and develop computer programs in the areas related to algorithms, system software, multimedia, web design, big data analytics, and networking for efficient design of computer-based systems of varying complexity.
PSO2: Problem-Solving Skills: The ability to apply standard practices and strategies in software project development using open-ended programming environments to deliver a quality product for business success.
PSO3: Successful Career and Entrepreneurship: The ability to employ modern computer languages, environments, and platforms in creating innovative career paths to be an entrepreneur, and a zest for higher studies.
4
CHALAPATHI INSTITUTE OF ENGINEERING & TECHNOLOGY
CHALAPATHI NAGAR, LAM, GUNTUR-522034 DEPARTMENT OF COMPUTER SCIENCE & ENGINEERING
INTERNET PROGRAMMING LAB OBJECTIVES:
1. Design to create structure of web page, to store the data in web document, and transport information through web
2. The student will be able to implement operating various application and data base servers
INTERNET PROGRAMMING LAB OUTCOMES:
C362.1: Analyze various TCP and UDP protocols. (Analysis)
C362.2: Experimenting the JAVA concepts for programming language.(Application)
C362.3:Student can be able to Explain html tags.(Knowledge)
C362.4: Design to create structure of web page, to store the data in web document, and transport information through web.(synthesis)
C362.5: The student will be able to implement operating various application and data base servers.(Evaluation)
Mapping of COs and POs
CO PO1 PO2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PO12 PSO1 PSO2 PSO3 C362.1 3 2 2 1
C362.2 2 3 2 2 1
C362.3 2 3 3 1 1
C362.4 3 2 2 1 1
C362.5 2 3 2 1
Avg 2.6 2.6 2.2 1.3 1
5
1- HIGH 2-MEDIUM 3-LOW
S.NO LIST OF EXPERIMENTS Course
outcomes attained
Program outcomes attained
1
a) To write a java program to demonstrate the Text Field Control
b) To write a java program to demonstrate AWTButton
c) To write a java program to demonstrate the AWT Scrollbar
d) To write a java program to demonstrate the AWT Choice Control
e) To write a java program to demonstrate the AWT List Control
f) To write a java program to demonstrate the use of AWT Checkbox
Control
C362.1, C362.2
PO1,PO4
2
a) To write a java program to demonstrate the Flow Layout
b) To write a java program demonstrating the Border Layout
c) To write a java program to demonstrate the Grid Layout
d) To write a java program to demonstrate the Grid bag Layout
e) To write a java program to demonstrate the Card Layout
C362.2 PO1,PO2
3 Program to set URL, download homepage and display the contents
C362.2 PO3,PO4
4 To write a java socket program to demonstrate HTTP Request
C362.1 PO1,PO4
5 To write a java program to demonstrate a simple FTP operation
C362.3 PO2,PO1
6 To write a java socket program to implement a simple SMTP client
C362.2 PO4,PO2
6
7 To write a java socket program to implement a POP3 Client
C362.2 PO3,PO4
8 To write a java program to create a simple chat application with datagram
sockets and packets C362.1 PO1,PO4
9 To write html and servlet to demonstrate invoking a servlet from a html
C362.3 PO2,PO1
10 To create a web page which includes a map and display the related
information when a hot spot is clicked in the map C362.2 PO4,PO2
7
SYLLABUS AS PER UNIVERSITY:
Expt. No Experiment Name
1 a) To write a java program to demonstrate the Text Field Control
b) To write a java program to demonstrate AWTButton
c) To write a java program to demonstrate the AWT Scrollbar
d) To write a java program to demonstrate the AWT Choice Control
e) To write a java program to demonstrate the AWT List Control
f) To write a java program to demonstrate the use of AWT Checkbox Control
2 a) To write a java program to demonstrate the Flow Layout
b) To write a java program demonstrating the Border Layout
c) To write a java program to demonstrate the Grid Layout
d) To write a java program to demonstrate the Grid bag Layout
e) To write a java program to demonstrate the Card Layout
3 Program to set URL, download homepage and display the contents
4 To write a java socket program to demonstrate HTTP Request
5 To write a java program to demonstrate a simple FTP operation
6 To write a java socket program to implement a simple SMTP client
7 To write a java socket program to implement a POP3 Client
8 To write a java program to create a simple chat application with datagram sockets and
packets
9 To write html and servlet to demonstrate invoking a servlet from a html
10 To create a web page which includes a map and display the related information when a hot
8
spot is clicked in the map
EXPERIMENT- 1
1 a) AIM: To write a java program to demonstrate the Text Field Control
Algorithm:
Step 1: Import the necessary package java.awt.*;,java.awt.evet.*;,java.applet.*; Step 2: Declare the class AWTControls and implements Action listener, item Listener, Adjust Listener Step 3: Include there component with text fields
9
Step 4: implement action performed event and create the object for action performed Step 5: Add action listener for every object component. Step 6: Declare the paint function and display the object Step 7: Terminate the program
1b) AIM: To write a java program to demonstrate AWTButton
Algorithm:
Step 1: Import the necessary package java.awt.*;,java.awt.evet.*;,java.applet.*; Step 2: Declare the class AWTControls and implements Action listener, item Listener, Adjust Listener Step 3: Include there component with buttons Step 4: implement action performed event and create the object for action performed Step 5: Add action listener for every object component. Step 6: Declare the paint function and display the object Step 7: Terminate the program
1c) AIM: To write a java program to demonstrate the AWT Scrollbar
Algorithm:
Step 1: Import the necessary package java.awt.*;,java.awt.evet.*;,java.applet.*; Step 2: Declare the class AWTControls and implements Action listener, item Listener, Adjust Listener Step 3: Include there component with Scrollbars Step 4: implement action performed event and create the object for action performed Step 5: Add action listener for every object component. Step 6: Declare the paint function and display the object Step 7: Terminate the program 1d) AIM: To write a java program to demonstrate the AWT Choice Control
Algorithm:
Step 1: Import the necessary package java.awt.*;,java.awt.evet.*;,java.applet.*; Step 2: Declare the class AWTControls and implements Action listener, item Listener, Adjust Listener Step 3: Include there component with Choice control Step 4: implement action performed event and create the object for action performed Step 5: Add action listener for every object component.
10
Step 6: Declare the paint function and display the object Step 7: Terminate the program
1e) AIM: To write a java program to demonstrate the AWT List Control
Algorithm:
Step 1: Import the necessary package java.awt.*;,java.awt.evet.*;,java.applet.*; Step 2: Declare the class AWTControls and implements Action listener, item Listener, Adjust Listener Step 3: Include there component with List control Step 4: implement action performed event and create the object for action performed Step 5: Add action listener for every object component. Step 6: Declare the paint function and display the object Step 7: Terminate the program
1f) AIM: To write a java program to demonstrate the use of AWT Checkbox Control
Algorithm:
Step 1: Import the necessary package java.awt.*;,java.awt.evet.*;,java.applet.*; Step 2: Declare the class AWTControls and implements Action listener, item Listener, Adjust Listener Step 3: Include there component with Checkbox control Step 4: implement action performed event and create the object for action performed Step 5: Add action listener for every object component. Step 6: Declare the paint function and display the object Step 7: Terminate the program
EXPERIMENT-2
2a) AIM: To write a java program to demonstrate the Flow Layout Algorithm: Step 1:Import all necessary packages and classes Step 2: Declare an array of buttons and three panels
11
Step 3: In the init() method of the applet do the following: i) Set the layout of the applet to Grid layout that can hold three columns ii) Create the array of buttons iii) Add a panel, set the layout to Flow layout to add buttons from the center iv) Add the buttons to the panel v) Similarly create two more panels and set layout to flow layout to add the buttons from the left and right of the flow layout. vi) Add the buttons in to these panels
2b) AIM: To write a java program demonstrating the Border Layout
Algorithm: Step 1. Include the applet tag with code set to the class name of the applet as comment Step 2. Import all the required packages and classes
12
Step 3. Define class which extends Applet and implements ActionListener Step 4. Declare buttons green, red, blue, red and font Step 5. Declare msg of type String and initialize to "sethu Institute" Step 6. Declare a Textarea area Step 7. In the init method of the applet, do the following i) Set the layout to border layout ii) Create area object and set its text to msg and add it to the center of the borderlayout iii) Create green button and add it to the north of borderlayout. Similarly, create red, blue,font buttons and add them to south,east, west of border layout. iv) Add action listener to all the buttons Step 8: In the actionperformed method do the following i) Get the action command of a button pressed in a string str ii) If str is equal to any one of the color button's text then set the foreground to that color. iii) If str is equal to font then create a new font of type Garmond and set the area's font tothe newly created font iv) Repaint the applet Step 9: write the paint method with no body (empty paint method)
2 c) AIM: To write a java program to demonstrate the Grid Layout Algorithm: Step 1: Write an applet tag with code property set to class name and comment it Step 2: import all the necessary packages Step 3: Define a class which extends Applet Step 4: Declare any number of buttons Step 5: In the init() method do the following:
13
i) Create a panel ii) create the buttons iii) set the layout of the panel to Gridlayout iv) add the buttons to the panel v) set the layout of the applet to borderlayout vi) add the panel to the center of the border layout Step 6: Write empty paint() method
2 d) AIM: To write a java program to demonstrate the Grid bag Layout
Algorithm Step 1: Write a html applet tag with code property set to class name and comment the tag
Step 2: Import all necessary packages
Step 3: Define a class which extends applet class
Step 4: Declare all the necessary awt controls to be included in the purchase form
Step 5: In the init() method, do the following
:i) Create a gridbag layout and set the applet's layout to gridbag layout
ii) Create a gridbag constraint
iii) Create a awt control
iv) Set the gridbag constraints for this control
v)Add the control to the applet
vi) Similarly do the steps from iii) to v) for all other control
2 e) AIM: To write a java program to demonstrate the Card Layout
Algorithm: Step 1: Write a html applet tag with code set class name and comment the tag
Step 2: Import all necessary packages and classes
Step 3: Define a class that extends applet and implements action listener
Step 4: Declare buttons tiny, large, medium, and small
14
Step 5: Create panels for card layout and for cards of buttons
Step 6: In the init() method, do the following:
i)Create the card layout
ii) Create the cardpanel and set its layout to card layout
iii) Create other panels and set their layout to border layout
iv) Create buttons and change their fonts to vriuos font face and sizes according to the button name
v)Add action listener to the buttons and each button to one panel of appropriate name
vi) Add the panels to the card panel
vii)Set the layout of the applet to border layout and add card panel to the applet
Step 7: In the actionPerformed() method, move to the next card in the card panel
EXPERIMENT-3
3.AIM: Program to set URL, download homepage and display the contents using html
Algorithm: Step 1: open html statndard tags Step 2: to set URL using anchor tag
15
Step 3: reference appropriate links Step 4: Close the tags
EXPERIMENT-4
AIM: To write a java socket program to demonstrate HTTP Request
Algorithm: Step 1: Import all the necessary packages Step 2: Create an URL to the server specifying the html page
16
Step 3: Get the host and port details from the URL Step 4: Request the file from the server using GET method of HTTP Request Step 5: Receive the response from the server Step 6: Display the response on the console
EXPERIMENT-5
AIM: To write a java program to demonstrate a simple FTP operation Algorithm: FTP Client: Step 1: Establish a connection with the server at a particular port Step 2: Specify the name of the file to be read
17
Step 3: Receive the contents of the file from the server FTP Server: Step 1: Accept the connection with the client Step 2: Listen to the port for the name of the file to be sent Step 3: Send the file character by character Step 4: Terminate the connection
EXPERIMENT-6 AIM: To write a java socket program to implement a simple SMTP client
Algorithm
18
Step 1: Import all necessary packages Step 2: Establish a connection with the server Step 3: Read the acceptance from the server Step 4: Say HELO to the server Step 5: Read the greeting from the server Step 6: Send sender address to server Step 7: Read the verification of sender from server Step 8: Send recipient address to server Step 9: Read the verification of recipient from server Step 10: Send DATA command to the server Step 11: Read the start indication from server Step 12: Send the message to the server Step 13: Read the acceptance of message from server Step 14: Close the connection
EXPERIMENT-7
AIM: To write a java socket program to implement a POP3 Client
Algorithm
19
Step 1: Get the host name, mailbox user name and password Step 2: Establish the connection with the server Step 3:Get the number of messages Step 4: Retrieve a message whose number is specified by the user Step 5: Repeat steps 3 and 4 until the user enters Q to quit
EXPERIMENT-8
AIM: To write a java program to create a simple chat application with datagram sockets and packets
20
Algorithm Server Side Step 1: Import net and io packages and class step 2: Create a datagram socket and datagram packet step 3: While client send datagram packet to server listen to client port step 4: Get the datagram packet into a string step 5: Display the string Client Side step 1: Import net and io packages step 2: Create a datagram socket and datagram packet step 3: Get input from the user and convert the string into a datagram packet step 4: send the datagram packet to the server through serve port
EXPERIMENT-9
AIM: To write html and servlet to demonstrate invoking a servlet from a html
Algorithm:
21
Step 1: Write the html file with form whose action attribute is set to the location of servlet and method is set to post Step 2: Create an input in the html to trigger calling servlet Step 3: Write a servlet program with doPost method which will give a response to the user as an html file
EXPERIMENT-10
22
AIM: To create a web page which includes a map and display the related information when a hot spot is
clicked in the map
Algorithm: Step 1: Create a html file with map tag Step 2: Set the source attribute of the img tag to the location of the image and also set the usemap attribute Step 3: Specify an area with name, shape and href set to the appropriate values Step 4: Repeat step 3 as many hot spots you want to put in the map
Step 5: Create html files for each and every hot spots the user will select