K. K. Wagh Polytechnic, Nashik-3

paltryboarpigΛογισμικό & κατασκευή λογ/κού

3 Νοε 2013 (πριν από 3 χρόνια και 7 μήνες)

421 εμφανίσεις

1

|
P a g e


K. K. Wagh Polytechnic, Nashik
-
3

Department of Computer
& Information
Technology
(Second Shift)

Question Bank

Clas
s: TYCM
-
IF








Date:

Sub: AJP (12259
)


Ch 1: Introduction to AWT Components


a)

What do you mean by Layout Manager? List different
layout managers.

b)

What are font & font metrics classes? Explain with the help of example to set font to
text.

c)

What is frame? Write procedures to close frame with the help of example.

d)

Write a program to demonstrate the use of Border Layout which shows four b
uttons
at 4 sided of an applet with captions as East, West, North & South. (8 Mks)

e)

What are dialog boxes? Give the type of dialog boxes.

f)

Explain any four methods of checkbox class with syntax.

g)

Write a program to create an applet that will accept values

of three numbers i.e.
num1, num2, num3. The user will enter the values in three separate test fields. The
applet will have two buttons labeled “ Find Largest” & “Find Smallest”. When the user
will clck on the button “Find Largest”, the largest value amon
g the three numbers will
be displayed in fourth text field & when the user will click on the button “Find
Smallest”, smallest value among the three numbers will be displayed in fourth text
field ( labeled as Result) (8 Mks)

h)


Explain the use of button contr
ol in AWT with example.

i)

Write a program to create an applet that will accept a number in a text field & display
factorial of that number in another text field when the button caption “Factorial” is
clicked. (8 Mks)

j)


Explain the use of scrollbar & adjustmen
t event class along with its constructors.

k)


Write constructors for color class & method for drawing polygon.

l)


Write a program to create an applet which will accept 2 nos from users & will provide
result of four operations i.e. addition, subtraction, multip
lication, & division. On
selection of any of these items operations provided in one choice box. (8 Mks)

m)


Explain the use of following methods of List class along with their syntax

i)

getItem()

ii)

add()

iii)

getItemCount()

iv)

select()

n)


Write a program to create an applet that will display the name, family, size & style of
currently selected font.

o)


Write a program to create an applet that will accept values of three test marks i.e.
test1, test2, test3 each out of 25. The user will enter
the marks in three separate text
fields. The applet will have a button labeled “Find average”. When the user will click
on the button the average of test marks will be displayed in fourth text field.




2

|
P a g e


Ch2
:
The Tour of Swing

a)

Differentiate between AWT & Sw
ing.

b)

Give the use of following:

i)

JTabbedPane

ii)

JTree

c)

Give sequential steps to use JTabbedPane control. Also give syntax of three


constructors of JTabbedPane class.

d)

Write a program to display a JComboBox on applet. The combo box will have t
he


following items
-

Banana, apple, orange, chickoo, grapes.

e)

What is scroll pane? Give the sequential steps to use JScrollPane control of swing.

f)

Give the sequential steps to use JTree control of swing. Also give syntax of four


constructors of JTree class.

g)

Write a program to display JTabbedPane in applet using swing.

h)

Write a program to create a frame using swing with title “changing colors” having


buttons Red, Green, Blue. Clicking on this button background should c
hange to


respective colors.

i)


Write a program to display a button with an image on it using swing. The image



on the button will change when the button is clicked.



Ch
-
3 Networking


a)

Write a sequential steps to establish connection between client socket & server
socket










( 4 M)

b)

Write to print protocol, port, host, file of
http://www.javasoft.com/download.htm
(4

M)

c)

Descri
be the meaning of
-

i) port ii) URL






(4 M)

d)

Give meaning and purpose of proxy server.





(4 M)

e)

What is Internet Addressing? Explain the purpose of InetAddress class.( 4 M)

f)

Describe the purpose of the following.

i) Reserved Sockets ii) Proxy server

g)

Describe the use of the following with DatagramPacket class.

i) getPort( ) ii) getData( )







(4 M)

h)

Give the use of URL class along with the syntax of constructors.


(4 M)

i)

Write a program to retrieve & display host name & port number using InetAd
dress
class. (4 M)


Ch
-
4
-

J
ava
D
atabase
C
onnectivity(JDBC)



a)

Describe the following terms
-

i) ODBC ii) JDBC
-
ODBC bridge



( 4M)

b)

Write a program to create connection to database
product

and create one table
product_data

& insert 3 records in it.







(8 M)

c)

Describe the use of following terms

i) DriverManager ii) Connection iii) ResultSet.





( 6 M)


d) Write use of the following methods in Statement interface

3

|
P a g e



i) executeQuery( ) ii) executeUpdate( )





(4 M)


e) Classify JDBC d
river types according to their architecture.



(4 M)


f) Describe the use of commit & rollback methods of connection interface.

( 4M)


h) Describe the syntax & use of 4 methods for navigation through database records


using resultset object








(4 M)

i)

Describe the use of JDBC
-
ODBC bridge.





( 4 M)

j)

Write a program to make the connectivity with database using JDBC & display
records in the table. Assume the suitable data.






( 6 M)

k)

Explain PreparedStatement interface with example




( 4 M)

l)

Describe two
-
tier & three
-
tier database design of JDBC API with neat diagram( 8 M)




Ch
-
5
-

Servlet


a)
Describe the following
-

i) Cookies ii) Session

b)

Write a program to demonstrate use of doGet( ) method of HttpServlet class.

c)

Write a code seg
ment to pass username & password and retrieving values of



parameters to servlet.

d)

Write a servlet to store password accepted from client in a cookie and display it.

e)

Write a program to display session ID using servelt.

f)

List any four interfaces in jav
ax.servlet package and also give the use of each.

g)

Explain life cycle of servlet.

h)

Write a code segment to demonstrate reading initialization parameters to servlet.

i)

Write a program to create servlet that handles HTTP post request.

j)

Explain the use of the fo
llowing methods of ServletRequest interface along with
syntax

i) getContentType( ) ii) getParameterNames() iii)getReader( ) iv)getParameter( )

k)

Explain the difference between doGet( ) & doPost( ) method.

l)

Write a servlet which shows how many times
user has visited the page in session.

m)

Write a servlet to display data stored in a cookie. Data will be username given by
client.

n)

Write a program of servlet to display “ Welcome to Servlet” using GenericServlet
Class.





Mrs.Patel M.A

Subject Teacher

Cc
-
Course File(AJP)