100
7 Worksheet 1 Q.1 Define web publishing? ____________________________________________________________________ __________ ____________________________________________________________________ __________ Q.2 Define URL? ____________________________________________________________________ __________ ____________________________________________________________________ __________ Q.3 What is the significance of HTTP? ____________________________________________________________________ __________ ____________________________________________________________________ __________ Q.4 What do you understand by a web server? ____________________________________________________________________ __________ Prepared & Compiled by Alpana Saxena

WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

  • Upload
    others

  • View
    4

  • Download
    0

Embed Size (px)

Citation preview

Page 1: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

7

Worksheet 1

Q.1 Define web publishing?

______________________________________________________________________________

______________________________________________________________________________

Q.2 Define URL?

______________________________________________________________________________

______________________________________________________________________________

Q.3 What is the significance of HTTP?

______________________________________________________________________________

______________________________________________________________________________

Q.4 What do you understand by a web server?

______________________________________________________________________________

______________________________________________________________________________

Q.5 Name two transmission media for networking?

______________________________________________________________________________

______________________________________________________________________________

Q.6 What is Firewall?

______________________________________________________________________________

______________________________________________________________________________

Q.7 Which address of two computers on a network cannot be same?

_____________________________________________________________________________

Q.8 Microwaves are unidirectional or omnidirectional?

_____________________________________________________________________________

Prepared & Compiled by Alpana Saxena

Page 2: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

8

Q.9 This device regenerates & restrengthen the signal.

______________________________________________________________________________

Q.10 Difference between UTP & STP.

_______________________________________________________________________________

_______________________________________________________________________________

Q.11 What are the parts of an optical fibre cable?

_______________________________________________________________________________

Q.12 An intelligent device that connects several nodes to form a network and redirects the received

information only to the intended node.__________________________

Q.13 Name the network which is used by the repeaters._______________

Q.14. A school wants to go in for network of all the computers. Which topology would you

recommend & why?

___________________________________________________________________________

____________________________________________________________________________ Q.15. Write the Difference & similarity between switch & hub.

___________________________________________________________________________

___________________________________________________________________________ Q.16 How TCP/IP works.

___________________________________________________________________________

___________________________________________________________________________

Q.17 What is domain name? Name some generic & Country specific name?

____________________________________________________________________________

____________________________________________________________________________

____________________________________________________________________________

Q.18 Mention the threats to Network Security?

____________________________________________________________________________

____________________________________________________________________________

____________________________________________________________________________ Prepared & Compiled by Alpana Saxena

Page 3: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

9

Worksheet 2

Q.1 The IIBM has to set up its new branch at Manipur for its office and web based activities. It has Wings of buildings as shown in the diagram:

Center to center distances between various blocksWing X to Wing Z 40mWing Z to Wing Y 60mWing Y to Wing X 135mWing Y to Wing U 70mWing X to Wing U 165mWing Z to Wing U 80m

Number of Computers

Wing X 50Wing Z 130Wing Y 40Wing U 15

(i)Suggest a most suitable cable layout of connections between the Wings and (ii) Suggest the most suitable place (i.e. Wing) to house the server of this organization(iii) Suggest the placement of the following devices with justification:

(a) Repeater (b) Hub/Switch

Prepared & Compiled by Alpana Saxena

Wing Z

Wing X Wing U

Wing Y

Page 4: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

10

Q.2 Define Radiowave and Microwave. Mention the name of two devices each in which they are used? _______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

_______________________________________________________________________

Q.3 Explain DNS & DNR? ________________________________________________________________________

________________________________________________________________________

________________________________________________________________________

________________________________________________________________________

Q.4 Give one example of each WAN, MAN, LAN, PAN?

________________________________________________________________________

________________________________________________________________________

_________________________________________________________________________

Q.5 Network is required .Why?

_________________________________________________________________________

_________________________________________________________________________

************

Prepared & Compiled by Alpana Saxena

Page 5: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

11

Worksheet 3

Q.1 Write attributes of the tags given below:

1) < P> ________

2) <UL> _______

3) <OL> ________

4) <TABLE> ___________

5) <TEXTAREA> _________________

6) <TR> _______________

7) <BODY> _______________

8) <FONT> ________________

9) <TD> _____________

10) <INPUT > _____________________

Q.2 Write functions of the following tags:

1) <Body link =” “>

2) <Body Alink=” “>

3) <Body Vlink=” “>

4) &nbsp

5) <select.........><option value........>

Q.3 Write full forms of the following:

1) XML 2) HTML

3) ISP 4) HTTP

5) HREF 6) URL

Prepared & Compiled by Alpana Saxena

Page 6: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

12

7) RDF 8) XSLT

9) WAI 10) CSS

11) JPEG 12) GIF

Q.4 Write HTML code for: 1) Short term courses 2) IT Companies

Windows XP I Infosys Windows Vista II TCS Java Net beans III Wipro Open office

Q.5 Write HTML codes for:

Production

N.N Reddy 1493

S M Krishna 3829

P. Chidambaram 0283

Sales

Maria Philip 4827

S.GANDHI

Q.6 Create an XML document to represent the marksheet of 5 students on the browser. OR Create an XML document to create the details of employees in a company.Q.7 Write answer in one word 1) Name one empty tag

2) Syntax of comment tag

3) Which tag identifies the document as html tag?

4) A tag having closing tag

5) Which kind of list is bulleted list?

6) What character is displayed with password field?

7) What is the type field for radio button?

8) Type field for checkbox button.

9) Set of rules/tags that define the structure & format of text while presenting them.

Prepared & Compiled by Alpana Saxena

Page 7: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

13

***************

Worksheet 4

Q.1 Define the following terms :( 8)1) Database 2) Encapsulation3) Inheritance4) Frontend5) Resultset6) Transaction

Q.2 Answer the following in one word :( 10)1) He invented Java2) Language which is both platform & programming Language3) Character set used by Java4) Interpreter of Java5) It helps in developing applications through pre-programmed tools.6) In which kind of literals is “\n” & “\b”7) What are these called :( ),{ },[ ]8) This keyword tells the compiler that value cannot be changed.9) Name one method to convert number to string.10) Name one which retrieves the text typed in text field.

Q.3 Write the functions of the following methods with syntax :( 10)1) isEditable( )2) setVisible( )3) isEnabled( )4) append( )5) isSelected( )6) getSelectedItem( )7) getSelectedValue( )8) ShowMessageDialog( )9) ShowInput Dialog( )10) SetText( )

Q.4 Do as directed:( 14)1) Convert a string to number.2) Convert a number to string.3) Get the output of:

a) int x; x=5; System.out.print(x++); System.out.print(x); System.out.println (++x);

Prepared & Compiled by Alpana Saxena

Page 8: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

14

b) int a=1,b=2,c=4:a=++b/c;System.out.printLn (“ “+a+ “\n” +(c++));

c) int I=7;System.out.print (++I);System.out.print (I);System.out.print (I++);

4) Identify the valid identifiers:a) Var.1 b) roll no c) D23 d) S$ e) emp no f) 2A g) withdraw

Q.5 Explain the function of commit, rollback & save point?Q.6 Explain call by value & call by reference? Q.7 Mention atleast 5 controls which you use to make an application. (2)Q.8 Explain the GUI builder & Netbeans IDE’s different parts. (2)

**************

Prepared & Compiled by Alpana Saxena

Page 9: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

15

Worksheet 5

1. Give the output of the following code fragment.(a) int ch=10; System.out.println (ch++); System.out.println (++ch); System.out.print (ch); (i)What output does the above code fragment produce? (ii)What is the effect of replacing ++ch with ch+1?(b) int val,res,n=1000; res= (n+val)>1500? 200:400; System.out.println (res); (i)If the input is 400 (ii)If the input is 1000 (iii)If the input is 15002. What will be the result of the following two expressions if i=15 initially? (i)++i<=15 (ii) i++<=153. Given the two following expressions: (i) a=4 (ii) a==4 (i)How are these two different? (ii)What will be the result of the expression if the value of a is 6 initially?4. Will the value of y be the same for the two cases given below if x=42? (i) y=++x; (ii) y=x++;5. Consider the following code snippet: int i=10; int n=i++%5; What are the values of i and n after the code is executed?6. What will be the value of p=p*++j where j is 22 and p=3 initially? 7. What will be the result of the following expression? If (i) age=25(ii) age=65(iii) age=85 age>65? 350:1008. Develop an application that accepts principal amount, rate of interest and Time from the user then it computes the simple interest and displays it.

Prepared & Compiled by Alpana Saxena

Page 10: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

16

9. Design an application for four function calculator.

10. Which of the following will produce a value of 22 if x=22.9? (i)Math. Ceil(x) (ii) Math. Round(x) (iii) Math. Abs(x) (iv) Math. Floor(x)12.Give the output of the following code. int m=100; while (m>0) { if (m<10) break; m=m-10; } System.out.println (“m is”+m);13. Write a program to input a digit and print it in words. using switch. if (ch==’E’) eastern++; if (ch==’W’) western++; if (ch==’N’) northern++; if (ch==’S’) southern++; else unknown++;

***************

Prepared & Compiled by Alpana Saxena

Page 11: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

17

Worksheet 6

Q.1 Fill in the blanks:

1) The ______ method is used when we simply want to retrieve data from a table

without modifying the contents of the table.

2) The _______ method is used to extract specified number of characters from a

String.

3) A string method which does not accept argument._________

4) Which is not a valid method of the string class?

a) length ( ) b) concat ( ) c) trim ( ) d) round ( )

5) ________ class which contains methods for basic numerical operations.

6) Which is not a primitive data type in Java?

a) float b) int c) string 4) void

7) To execute sql statements, you need to initiate a ______ object using the ______

Object.

8) The ______ method is used to instantiate a statement object using the connection

Object.

9) The _______ method is used to move to the next row of the resultset.

10) _________ statement gives us the runtime error.

Q.2 Explain the significance of: 1) forName ( ) ___________________________________________________________________ 2) getModel ( )

Prepared & Compiled by Alpana Saxena

Page 12: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

18

___________________________________________________________________ 3) executeUpdate ( ) ___________________________________________________________________ 4) rs.next ( ) ____________________________________________________________________ 5) java.sql.* ____________________________________________________________________ Q.3. WAP to connect with mysql for retrieving data from a table with search button

according to the mobile no. given in the application.

____________________________________________________________________

____________________________________________________________________

____________________________________________________________________

____________________________________________________________________

____________________________________________________________________

____________________________________________________________________ Q.4 Write the correct order of the following steps for connectivity to update customer

Table:

1) execute s1

2) register the jdbc driver

3) create a statement s1 to update customers

4) execute s1

5) close connection

6) open connection to the database

7) close s1

________________________________________________________________

________________________________________________________________

Prepared & Compiled by Alpana Saxena

Page 13: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

19

_________________________________________________________________

**************

Worksheet 7Q.1 What do you mean by derived class/subclass & base class/super class? ________________________________________________________________________

________________________________________________________________________

_________________________________________________________________________

Q.2 What is a package in JAVA? _________________________________________________________________________

_________________________________________________________________________

Q.3 What is public access of class members?

_________________________________________________________________________

_________________________________________________________________________

Q.4 How are protected members different from private members.

_________________________________________________________________________

_________________________________________________________________________

Q.5 Define Polymorphism and Encapsulation? ________________________________________________________________________ ________________________________________________________________________

_________________________________________________________________________

_________________________________________________________________________

Prepared & Compiled by Alpana Saxena

Page 14: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

20

Q.6 What are abstract classes? Give example?

_________________________________________________________________________

__________________________________________________________________________

__________________________________________________________________________

Q.7. What do you mean by the term “INHERITENCE? Write its significance also. _______________________________________________________________________

_______________________________________________________________________ _______________________________________________________________________

Q.8 Answer in one word: 1) Keyword which makes the variable a class variable ________________ 2) Keyword used to call a method from the base class.________________ 3) Arguments contained in method call and passes is called______________ 4) This keyword is used to create an object ____________ 5) Variables & methods in a class are collectively called ____________. 6) Keyword to make a subclass.________________.

Q.91) Identify the super class & subclass in the following codes: public class Animal{ } public class Mammal extends Animal{ } public class Reptile extends Animal{ } 2) What are the objects created in the following codes? Animal a=new Animal ( ); Mammal m=new Animal ( ); Dog d=new Dog;

3) Explain inheritance in Java with example? _______________________________________________________________________

_______________________________________________________________________ _______________________________________________________________________

_______________________________________________________________________

Prepared & Compiled by Alpana Saxena

Page 15: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

21

_______________________________________________________________________

*************

Worksheet 8

Q.1 Fill in the blanks: 1) In Java, methods reside in _______________ 2) A member method having the same name as that its class is called ______________. 3) The keyword _______________ refers to current object. 4) An __________ is an instance of a class. 5) A ______________ constructor takes no arguments 6) The members of a class which are defined without the keyword static are ________. 7) The data types that are based on primitive data types are known as _______________ 8) Everything that exists in java program has to be through ___________ & objects. 9) Keyword static makes a method a _____________. 10) _______________ Parameters appear in method call. 11) _______________ Parameters appear in method definition. 12) A method is invoked in two manners __________ & _____________. 13) ________________ Data type specifies an empty set of values. 14) Java offers ___________, ________________ , _______________ classes to work with character Data. 15) Packages in java are called ________________.

Q.2 Define access specifiers and also explain private, protected and public access specifiers ___________________________________________________________________________ ___________________________________________________________________________ ___________________________________________________________________________

Q.3 What is the difference between ‘pass by value’ & ‘pass by reference methods’? ___________________________________________________________________________

Prepared & Compiled by Alpana Saxena

Page 16: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

22

__________________________________________________________________________

___________________________________________________________________________

Q.4 Explain keyword ‘this’? ___________________________________________________________________________ ___________________________________________________________________________

Q.5 Write a program to design a GUI application to print square of natural numbers till n. ___________________________________________________________________________ ___________________________________________________________________________

Q.6 WAP to design a GUI application to print prime nos. till 10. ___________________________________________________________________________ ___________________________________________________________________________ ___________________________________________________________________________

*********

Prepared & Compiled by Alpana Saxena

Page 17: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

23

Worksheet 9

Q.1 Answer in one word: a) Device used to connect several computers. b) A system to prevent unauthorized access to/from a network. c) Device that connects dissimilar networks. d) Pairs of copper wires twisted around each other. e) This cable uses light to transmit data instead of magnetic signals f) One network, this is your computer’s unique hardware number. g) This is the unique name given to site that becomes websites identification. h) The arrangement of computers in a network. i) The operator which needs three operands. j) Which code is used by Java? k) Reserved word having special meaning and purpose l) Tools that enable the fast creation of application m) The commands in HTML n) The part of XML document where we define the introduction of the document. o) The tags who don’t have the ending tag p) The text which can be linked Q.2 Find the output of the following: 1) int r,x=50,y=10; R=(x>45)?x:y; System.out.println(x);

2) int p=10,k=20; K=k/++p; System.out.println (“k=”+k);

3) int z,x=5,y= -10,a=4,b=2; Z=x++- --y*b/a;

4) char ch=’a’; Prepared & Compiled by Alpana Saxena

Page 18: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

24

ch=(ch==’b’)?ch:’b’; System.out.println (“k=”+k);

5) int a=10; Int b=5; Int c=7; System.out.println (a+b+c); System.out.println (); System.out.println (a+”t”+b+”t”+c); System.out.println (); System.out.println (a+”\n”+b+”\n”+c);

6) int i=10; Int j, k, l, m,n; J=i+5; K=i+j/5; L=k+1; M=l+1+i; N=k+m*l; System.out.println (i+”\n”+k+”\n”+l+”\n”+m+”\n”+n); 7) int c=0,i=2; While (i<10){c=++i-i*2;} System.out.println (“c=”+c+”i=”+i); 8) int i, j,k,x=0; For (i=0; i<5; ++i) For (j=0; j<i; ++j) { K= (i+j-1); if (k%2==0) x+ =k; else if (k%3==0) x+=k-2; system.out.println (x+” “) ;} System.out.println (“\n”+x);

Q.3 Write the HTML code for the following:

ProductionReddy 493

SalesGandhi 7246

***********

Prepared & Compiled by Alpana Saxena

Page 19: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

25

Worksheet 10

Q.1 Define the following terms:7) Database

______________________________________________________________________

______________________________________________________________________

8) Encapsulation______________________________________________________________________

______________________________________________________________________9) Inheritance

______________________________________________________________________

______________________________________________________________________10) Frontend

______________________________________________________________________

______________________________________________________________________11) Resultset

______________________________________________________________________

______________________________________________________________________ 12) Transaction

______________________________________________________________________

______________________________________________________________________ Q.2 Answer the following in one word:

Prepared & Compiled by Alpana Saxena

Page 20: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

26

1) He invented Java 2) Language which is both platform & programming Language 3) Character set used by Java 4) Interpreter of Java 5) It helps in developing applications through pre-programmed tools. 6) In which kind of literals is “\n” & “\b” 7) What are these called :( ),{ },[ ] 8) This keyword tells the compiler that value cannot be changed. 9) Name one method to convert number to string. 10) Name one which retrieves the text typed in text field.

Q.3 Write the functions of the following methods with syntax:11) isEditable( )12) setVisible( )13) isEnabled( )14) append( )15) isSelected( )16) getSelectedItem( )17) getSelectedValue( )18) ShowMessageDialog( )19) ShowInput Dialog( )20) SetText( )

Q.4 Do as directed :5) Convert a string to number.6) Convert a number to string.7) Get the output of:

a) int x; x=5; System.out.print(x++); System.out.print(x); System.out.println (++x);

b) int a=1,b=2,c=4:a=++b/c;System.out.printLn (“ “+a+ “\n” +(c++));

c) int I=7;System.out.print (++I);System.out.print (I);System.out.print (I++);

8) Identify the valid identifiers:

Prepared & Compiled by Alpana Saxena

Page 21: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

27

a) var.1 b) roll no c) D23 d) S$ e) emp no f) 2A g) withdraw

Q.5 Explain the function of commit, rollback & save point?Q.6 Explain call by value & call by reference? Q.7 Mention atleast 5 controls which you use to make an application. (2)Q.8 Explain the GUI builder & Netbeans IDE’s different parts. (2)

**************

Worksheet 11

Q.1 Write answer in one word: a) It combines rows from one or more tables. b) Join in which tables are combined with each other without equality condition. c) It can combine two select statements d) It makes sure that referential integrity is maintained. e) Rules which are applied to the columns of a table. f) These functions work on values or expressions and returns a value. Q.2 Write queries for the following:

a) Add a new primary key (name) in table t1 b)

c) Change the column Bill date constraint Null to Not null

d) Delete column A,B & C from T1.

___________________________________________________________________e) Change the name of a column

Q.3Consider the three tables below & writes the queries for the statements given below:: Prepared & Compiled by Alpana Saxena

Page 22: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

28

DOCTORID NAME DEPT GENDER EXP P_CODE S_CODE101 John ENT M 12 PO1 S002104 Smitha ORTHPEDIC F 10 P02 S004105 George CARDIO M 9 P03 S010114 Lara ENT F 3 P04 S006111 Bill MEDICINE M 12 P05 S003130 Lucy ORTHPEDIC F 15 P05 S015190 Morphy SKIN M 5 P06 S011

SALARY ID BASIC ALLOWANCE S_CODE CONSULTATION101 120000 1000 S002 300104 230000 2300 S004 500105 320000 4000 S010 500114 120000 5200 S006 400111 1890000 1700 S003 200130 217000 1690 S015 400190 140000 2600 S011 200

PATIENT

ID P_CODE PNAME S_CODE101 PO1 RAKESH S002104 P02 MAHESH S004105 P03 RAVI S010114 P04 LILLY S006111 P05 UMA S003130 P05 UTTAM S015190 P06 ROCKY S011

a) Display the Name of all the doctors who are in “Medicine” having more than 10 years experience and basic more than 10000.__________________________________________________________________

b) Display the average of all doctors working in “ENT” department using the table DOCTOR and SALARY(salary=basic allowance)__________________________________________________________________

Prepared & Compiled by Alpana Saxena

Page 23: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

29

c) Display the highest consultation fee among all male Doctors.

d) Select Name,Dept,basic from Doctor, salary where dept=’ENT’ & Doctor.ID=salary.ID.(give output)

e) Display the consultation fee of all the doctors whose allowance is more more than 150000. ___________________________________________________________

f) Display the whole data for the patients of orthopaedic & skin.

___________________________________________________________

Q.4 Define Referential integrity and write two advantages of using Constraints? _____________________________________________________________

_____________________________________________________________

_____________________________________________________________

***************

Prepared & Compiled by Alpana Saxena

Page 24: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

30

Worksheet 12Q.1 Write the commands for the following:

a) Creating a database

b) Inserting values in a table

c) To show the data in a table

d) Display non-redundant data

e) To view structure of a table

f) To specify a condition based on a value

g) To display the names whose starting word is ‘B’?

h) To display the area whose pin code is starting from ‘12’?

i) To sort an aggregate column of student table in ascending order.

j) Display the students name from student table whose percentage is in the range 90-98.

k) To display a column of a table in lowercase.

l) To get the name of the weekday for the specified date

m) To return the day of the month in the range 0-31.

n) To remove both leading & trailing spaces from the string

Q.2 Write the output of the following SQL queries:

Prepared & Compiled by Alpana Saxena

Page 25: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

31

a) SELECT ROUND (8.6755, 2) + POW (4, 3);

b) SELECT TRUNCATE (6.2465, 1);

c) SELECT DAYOFMONTH (‘2009-08-24’);

d) SELECT MID (‘STUDENTS’, 2, 3);

e) SELECT SQRT (81), SQRT (17), SQRT (-1);

f) SELECT CONCAT (UPPER (‘xiHum’), LOWER (’xiSc’), UPPER (SUBSTR (‘xiCom’,

2, 3)));

Q. 3 In a database there are two tables ITEM & CUSTOMER as shown below:

ID ITEMNAME COMPANY PRICE

1001 Moisturiser XYZ 40

1002 Soap LOP 35

1003 Sanitizer MNC 25

1004 Shampoo ABC 95

1005 Lens Solution EFG 350

C_ID CNAME CITY ID

01 Mickey Delhi 1002

05 Tom Mumbai 1005

12 Dick Bangalore 1001

15 Harry Mumbai 1004

1) Increase the price of all by 50

2) Display Itemname,Company,Cname & City

3) Arrange C_ID in descending order

Prepared & Compiled by Alpana Saxena

Page 26: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

32

4) Display item name & city & change city from ‘Mumbai’ to ‘Pune’.

5) Display the place of items whose price is between 20 to 50

Q.4 Consider the table below. Write commands for (a) to (d) & Outputs for (e) to (h)

EXAM

No Name Stipend Subject Average Division

1 Karan 700 English 78 First

2 Jai 00 Physics 67 First

3 Aman 500 Chemistry 56 Second

4 Suparna 780 Mathematics 76 First

5 Pooja 200 Informatics 54 Second

6 Prashant 350 chemistry 45 Third

a) To obtain the names of those students who obtained first division in the ascending order of names

b) To count the students who have either chemistry or Informatics as subject.

c) To display a report listing name, Subject & stipend.

d) To insert a row.

e) Select avg (stipend) from exam where division is First.

f) Select count(distinct subject ) from exam

g) Select min (average) from exam where subject=’Chemistry’.

************

Prepared & Compiled by Alpana Saxena

Page 27: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

33

Worksheet 13

Q.1 Define: DBMS:_____________________________________________________________________ ___________________________________________________________________________

Alternate key___________________________________________________________________________

___________________________________________________________________________ Cardinality: __________________________________________________________________________

___________________________________________________________________________ SQL: ___________________________________________________________________________

Prepared & Compiled by Alpana Saxena

Page 28: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

34

___________________________________________________________________________

Q.2 Write commands & their syntaxes: Create a table: __________________________________________________________________________

___________________________________________________________________________

Add a column ___________________________________________________________________________

Open the database ___________________________________________________________________________

Enter values in a table ________________________________________________________________ List the tables existing in database ________________________________________________________________

Arrange the data in asc/desc order ________________________________________________________________

Show the structure of the table _______________________________________________________________

Change the value of a column _______________________________________________________________

Display distinct value from a column _______________________________________________________________

Q.3 Write methods for the following:

To return the value of x raised to the power of y _______________________________________________________________

Truncates the argument x to d decimal places _______________________________________________________________

Returns the last n characters from the string ________________________________________________________________

Prepared & Compiled by Alpana Saxena

Page 29: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

35

Returns the current date ________________________________________________________________

Returns the name of the weekday for the specified date ________________________________________________________________ Show the whole data in a table ________________________________________________________________

Q.4 Consider the table given below & write SQL queries for the tasks given below:

1) Display the

details of all the loans

___________________________________________________________ 2) Display the details of all the loans less than 40 installment

___________________________________________________________

3) Display the Acno. Cname & Loan amount

___________________________________________________________4) Display the loans with rate of interest

___________________________________________________________

5) Display all the loans in the ascending order

___________________________________________________________6) Delete the records of all the loans of K.Jain

___________________________________________________________

7) Increase the interest rate by 0.5% for all the loans for which the amount is 400000.

____________________________________________________________

****************

Prepared & Compiled by Alpana Saxena

Acno Cname Loan-amnt Installment Int_rate Start date1 K. Gupta 300000 36 12.00 19-07-20092 Sharma 500000 48 10.00 22-03-20083 K.Jain 300000 36 Null 08-03-20074 M.Yadhav 800000 60 10.00 06-12-20085 P. Sinha 200000 36 12.50 03-01-20106 K.Dhall 500000 60 Null 05-03-2008

Page 30: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

36

Worksheet 14 Q.1 Write queries for the following according to the table given below:

a) Create table Depart including constraints:

________________________________________________________________________

b) Add one more column Email of datatype Varchar and size 30 to the table Depart

______________________________________________________________________

c) Select all the department name in descending order.

_____________________________________________________________________

d) Select the department name whose distance is maximum.

____________________________________________________________________

e) Insert values in the table as S101, ‘Sales’, “delhi’, 120.

____________________________________________________________________

Prepared & Compiled by Alpana Saxena

Page 31: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

37

Column Name Dept ID DeptName DepartLOC Distance

Key Type Primary

Constraint NOTNULL

Datatype Number Varchar Varchar Number

Length 2 20 20 4

Q.2.a) Write an SQL query to create the table books with following structure.

Field Type ConstraintsBookID Varchar (5) Primary Key

BookName Varchar (20)Author Varchar (20)Price Decimal (5, 2)

_____________________________________________________________________

_____________________________________________________________________ b) Following two tables are shown below are preset in database- BOOK

EID EBook Name Author 3 Internal terms Okhla 4 RDBMS Steve 5 NetBeans Gosling

COST

Subj ID EID Cost E40 1 2000E41 4 1700E42 3 1800E43 5 1250

1) Identify the foreign key column in the table COST. _______________________________________________________________

2) Check every value in EID column of both in table. Do you find any discrepancy.

_______________________________________________________________

c) Consider the tables product and client give below Product

Prepared & Compiled by Alpana Saxena

Page 32: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

38

PID ProdName Manufactures Price T P01 Pen Cello 5T P02 Gel pen Luxar 10T P03 Ink pen Luxar 10T P04 Pencil Natraj 2T P05 Sketch Camel 2

Client

CID CliName City PID 01 Rakesh Delhi TP0102 Prakash Mumbai TP0503 Suresh Delhi TP0304 Dinesh Delhi TP0205 Pravesh Banglore TP04

a) To Display the details of products whose Price is in the range of 6 to 10 ______________________________________________________________

b) To display client name, city from table chart and ProdName and price

from table product. ___________________________________________________________ `

c) To increase the price of all products by 10. ______________________________________________________________

Q.3 Choose appropriate controls from TextField, Label, Radio Button, Checkbox,

List, ComboBox , Button and write in the third column.

S.No. Controls use to Control

1 Select room type 2 Enter customers name 3 Enter arrival date 4 To book rook

******************

Prepared & Compiled by Alpana Saxena

Page 33: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

39

Worksheet 15

Q1. Answer the following Questions:

1) Which network topology requires terminators at the ends of the lines?

____________________________________________________________________

____________________________________________________________________

2) Expand the term : GNU, PHP

____________________________________________________________________

____________________________________________________________________

3) How is coaxial cable different from optical fibre?

____________________________________________________________________

____________________________________________________________________

4) What is the difference between IP address and MAC address?

____________________________________________________________________

____________________________________________________________________

5) What is snooping and phishing?

Prepared & Compiled by Alpana Saxena

Page 34: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

40

____________________________________________________________________

____________________________________________________________________

6) What are the common threats to Network Security?

____________________________________________________________________

____________________________________________________________________

Q 2.a) What is XML? Write its advantages.

___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

b) What are the steps involved in JDBC connection? Mention the four classes used in

connectivity?

___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

c)Rewrite the code using While Loop?

int i,j;

for(i=1;i<=4;i++) {

for (j=1; j<=i; j++)

System.out.printl (“ “+j);

Sytem.out.println () ;}

Q 3 a) How is Back end linked to a Database and a Server?

___________________________________________________________________________ Prepared & Compiled by Alpana Saxena

Page 35: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

41

___________________________________________________________________________

b) You need to remove all the rows from the Sales_HIST table. You want to release the

storage space but do not want to remove the table structure. What is the solution to the

problem?

c) Differentiate between CHAR and VARCHAR data types?

Q.4 Predict the output:

i. Select round(29.21,1), round(32.76,1);

ii. Select power(2,5);

iii. Select 9 mod 2;

iv. Select concat(‘catch a ’ ,concat( ‘falling’, ‘star’));

v. Select length (trim ( ‘……..to be continued…’));

Q 5. What is significance of Group By Clause in used in SELECT query?

___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

Q.6 a)Define Equi join and non Equi join?

___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

b) What do you understand by Transaction COMMIT & ROLLBACK?

___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

c) What is constraint.? Explain the difference between default and check constraints.

___________________________________________________________________________ Prepared & Compiled by Alpana Saxena

Page 36: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

42

___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

*************

Worksheet 16

Q.1a) The Pincode column of table ‘Post’ is given below-

i). SELECT Pincode from Post where Pincode LIKE = “%1”; ________________________________________________

ii). SELECT Pincode from Post where Pincode LIKE = “0 %”; ________________________________________________ b) A table “Animals“in a database has 3 columns and 10 records. What is the degree and cardinality of this table? ___________________________________________________________________________

Q.2a) What will be the contents of jTextField after executing the following statement?

jTextField.setText (‘B’ + ‘a’)

Prepared & Compiled by Alpana Saxena

Pincode 110001120012300048281001

Page 37: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

43

b) Identify the errors and tell the output (jTF 1 = 20, jTF2 = 10)

(i) int m = integer.getInt (jTFl.getText () + jTFl.getText ()); (ii) JOptionPane.showMessageDialog (null, “ ” + (m +1));

c) Give the output for the following code fragment: v = 20; do { JOptionPane.showMessageDialog (null , v + “ ” ) ; } while (v < 50) ; JOptionPane.showMessageDialog (null, “Bye “ );

Q.3 Virus software Hut has developed the following Interface as shown below.

If Bill amount is > 10,000 than discount is as followPayment Mode Discount Cost 15 % Credit Card N/L Cheque 10

i)Writete the code to make the Text Fields for Discount & Net Amount in

ii) Write code to “Calculate Discount“button as per given criteria and discount and net amount should be displayed in Text Field. iii) Write code for “Stop“button to close the interface.

Prepared & Compiled by Alpana Saxena

Virus S/w Hut

Name of customer

Bill amount

O Cash O Credit Card O Cheque

Discount

Calculate Discount

Stop

Page 38: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

44

Q.4 a) Write the output of following SQL queries. i. SELECT ROUND (6.88, 2) ; ii. SELECT MID (‘Discovery Channel’, 4, 6) ; iii.SELECT DAYOFMONTH (‘2011–03–30‘); iv.SELECT TRUNCATE (7.727,1);

c) Consider the table STUDENT given below, write SQL Commands for (i) to (iv) and output for (v) to (viii)

RollNo Name Class DOB Sex City Marks 1 Nanda X 6/6/95 M Agra 5512 Saurabh XII 7/5/93 M Mumbai 4623 Sanal XI 6/5/94 F Delhi 4004 Trisla XII 8/8/95 F Mumbai 4505 Store XII 8/10/95 M Delhi 3696 Marisla XI 12/12/94 F Dubai 2507 Neha X 8/12/95 F Moscow 3778 Nishant X 12/6/95 M Moscow 489

1) To Display all information about class XII students. ____________________________________________________

2) List the name of made student of class X. ____________________________________________________

3) List names all class of all students in descending order of DOB. ____________________________________________________

4) To count the number of student in XII Class of Mumbai city. ____________________________________________________

5) SELECT DISTINCT (Sex) FROM Student. ____________________________________________________

6) SELECT AVERAGE (Marks) FROM Student GROUP BY Sex. ____________________________________________________

7) SELECT COUNT(*)FROM Student where Class = ‘XI’____________________________________________________

8) SELECT MAX (Marks) FROM Student.____________________________________________________

**************

Prepared & Compiled by Alpana Saxena

Page 39: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

45

Worksheet 17Q.1 Fill in the blank: 1) A website to provide online information and services to the citizens is an example of ______________

2) The website of an electricity supply company which allows its customers to pay bills online is an Example of ______________.

3) The website of a school which allows the students to go through various lessons in their Subjects Is an example of _____________

4) Web address of national portal of India is _____________

5) A form through which users interact with an IT application is a part of _____________.

6) A good front-end is ___________.

Q.2 Write two important features of each of the following: e- Governance ___________________________________________________________________________

___________________________________________________________________________ Prepared & Compiled by Alpana Saxena

Page 40: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

46

e- Business ___________________________________________________________________________

___________________________________________________________________________ e-Commerce ___________________________________________________________________________

___________________________________________________________________________

Q.3 Give domain names of two most commonly used websites for e-Governance, e-Commerce and e-Business? ___________________________________________________________________________ ___________________________________________________________________________

___________________________________________________________________________

Q.4 Mention few important points which you should keep in mind while developing an efficient and user friendly application? ___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

***********

Prepared & Compiled by Alpana Saxena

Page 41: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

47

Worksheet 18

Q 1. Answer the following questions: a) What type of network would you suggest for the following type of requirements in an organization? i) Around 200 computers in two different buildings adjacent to one another are to be connected. ii) The cost of network should not be very high. iii) It should be fairly easy to implement. ______________________________________________________________________________b) Mr. Vasu is transferring data to a large distance via cable connection and he wants to amplify the signal transmitting over a network. What device will be useful for him? ______________________________________________________________________________c) What do you mean by network topology? Write one advantage and one disadvantage of star topology. _______________________________________________________________________________

_______________________________________________________________________________

_______________________________________________________________________________ d) What is freeware? How is it different from free software? _______________________________________________________________________________ _______________________________________________________________________________e) Which of the following technologies require line-of site between the transmitter and receiver?

Prepared & Compiled by Alpana Saxena

Page 42: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

48

a) Satellite b) Fiber Optic c) Microwave d) Co-axial Cable ____________________________________________________________________________f) What is openoffice.org? ____________________________________________________________________________g) Which protocol is used for transfer files over the internet? ____________________________________________________________________________

Q 2. Answer the following questions.a)Mr. Nayak has developed a Java application for a school, in which, a combo box is made on the form for class. Name the property which Mr. Nayak should use to add the class’s data in combo box. ____________________________________________________________________________

b) Name the statements used for decision making in Java. ____________________________________________________________________________

c) Differentiate between <UL> and <OL> tags with example.. ____________________________________________________________________________

d) Write a method in Java that takes a number as parameter and returns True if the number is prime otherwise returns False. _____________________________________________________________________________

_____________________________________________________________________________

g) What are the use of the following tags- <TITLE>, <A>, <BR>, <U>

Q 3. a) Which MySQL command helps you to create database if it does not exist?b) How can we see the list of existing tables?c) Rajan created a table named Item, he wants to see those Items whose price is between 200 and 800. He wrote a query- SELECT * FROM Item WHOSE price>200 OR <800;Help Rajan to run the query by removing the errors from the query by rewriting it. d) Sanket wants to implement referential integrity in the tables being created. Which constraint should be used by Sanket while doing so?e) What is the role of primary key in the table? Explain with the help of suitable example.f) Room_No, Cust_Name, Room_Type and Room_Rent of table “HOTEL” are given below:

Table : HOTELRoom_No Cust_Name Room_Type Room_Rent204 Rajesh Single 700308 Anuja Double AC 1600105 Vinamra Single NAC 500202 Soma

Based on this information, find output of the following queries:a) SELECT Room_Type, SUM(Room_Rent) FROM hotel GROUP BY Room_Type;b) SELECT Room_no FROM hotel WHERE Cust_Name LIKE ‘%n%;

g) Define Domain and Tuple.

Q 4. a) What is Interface in Java? What purpose does it solve?b) Differentiate between function overloading and method overriding.

Prepared & Compiled by Alpana Saxena

Page 43: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

49

c) Write the purpose of the following statements: i) int n=Integer.parseInt(“1254”); ii) jButton1.doClick( );d) Rewrite the following code using while loop: int i,j; for(i=1,j=2;i<=6;i++,j+=2) System.out.println(i++); System.out.println(“Finished!!!”);

e) The following code has some error(s). Rewrite the correct code underlining all the corrections made. int y=6,p; do { y=3.14*y; p=y%10; if p=2 System.out.print(“Two”); while(y>1)f) What will be the content of jTextField1 and jTextField2 after executing the following code: String st=”New to Information Technology”; jTextField1.setText(st.replace(“Technology”,”Practices”); jTextField2.setText(st.substring(7));g) Mr. Madhav works in a construction company. To calculate total wages he has developed the following GUI in NetBeans.

Male and female labourers are respectively paid Rs. 150/- per day and Rs. 170/- per day. Skilled labourers are paid extra at the rate of Rs. 100/- day. Male and female labourers from rural areas are paid 10% less per day.

I. Write the code to lock the text box.( text box for total wages should not take input)II. Write code to do the following-

a) When Calculate Wage button is clicked, the total wages is calculated as per the given criteria and displayed in total wage text box.

b) When Clear button is clicked, all the text boxes should be cleared and radio button, check box should be deselected.

Prepared & Compiled by Alpana Saxena

Page 44: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

50

c) Close the application when Quit button is pressed.

Q 5. a) How can you remove the column of a table? Explain with example.b) What are TCL commands? Explain the role of Commit and Rollback with example. c) Consider the table Doctor given below, write command in SQL for (1) to (4) and output for (5) to (8).

Table : DOCTORID Name Dept Gender Experience ConstFee201 R.K. Nath ENT M 12 300457 Mahavir Singh SKIN M 500365 M. Asthana MEDICINE F 9 250221 V. S. Nag ENT M 3 150122 S. P. Sinha NEPHRO F 200110 J. P. Pandey CARDIOLOGY M 9 500

(1) To display name of all doctors who are in Medicine having more than 10 years of experience.(2) To display the different departments.(3) To display minimum consultation fee of female doctors(4) To display name and department of male doctors who has no experience.(5) SELECT AVG(ConstFee) FROM Doctor WHERE NOT Gender=’F’; (6) SELECT Count(Experience) FROM Doctor; (7) SELECT Name, Experience FROM Doctor WHERE id BETWEEN 100 AND 200;(8) SELECT SUM(ConstFee),MAX( Experience) FROM Doctor;

Q 6. Answer the following question.a) Write an SQL query to create the table “Items“ with the following structure-

Field Type ConstraintItem_Id Varchar(5) Primary KeyItem_Name Varchar(25)Manufacturer Varchar(15)Color Varchar(15)Price Integer Must between 399 and 4999Quantity Integer Not Null

b) In a database there are two tables ‘Dress’ and ‘Material’ shown below-Table: Dress

Dcode Description Price MCode LaunchDate1002 Trouser 999 M002 15-12-20102006 Coat 1599 M001 27-09-20091036 Sweater 540 M001 11-01-20081789 Frock 1950 M003 31-12-2010

Table: MaterialMCode TypeM001 WoolenM002 CottonM003 PolyesterM004 SilkM005 Denim

i) Name the columns which can be made ‘Foreign Key’ in both the tables.ii) To display the dress details which are made up of woolen?

Prepared & Compiled by Alpana Saxena

Page 45: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

51

c) Consider the tables given below.Table : Books

Book_Id Book_Name Author_Name Publisher Price Type QuantityB0001 Harry Potter J.K. Rolling BPB 525 Fiction 15B0013 Vision 2020 A.P.J.A. Kalam TMH 333 Informative 10B0152 Let Us C++ Y.K BPB 625 Text 50B1102 Applied Physics H.C. Verma 745 Text 44B2314 Godan Premchand 125 Novel 50

Table : IssuedBook_Id DateOfIssue Member_IDB0152 15-12-2010 M008B2314 25-10-2010 M112B0001 31-12-2010 M110

With reference to these tables, write commands in SQL for (i) and (ii) and output for (iii) below-(i) To display the name of the book issued to member M112.(ii) To display the type wise no. of books and total quantity of all type of book.(iii) SELECT Book_Name, Quantity FROM Books WHERE publisher IN(‘TMH’,NULL) ;

Q 7. a) What is database connectivity? b) Write the societal impact of e-learning? c) Mr. Akshat is working as a booking clerk in Raja Mahal Hotel. He wants to create the forms with the following functions. Choose appropriate controls from Text Field, Label, Radio Button, Check Box, List Box, Combo Box and Command Button and write in the third column.

SNo Control Used to Control1 Choose room type form a list of Room Type2 Display Room Number3 To show list of booked room4 To enter date of checkin

************

Prepared & Compiled by Alpana Saxena

Page 46: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

52

Worksheet 19

Q.1 Consider the table below: FURNITURE

S.no Name Type Date of Stock

Price Discount

1 Whitelotus Double bed 2002-02-23 30000 25

2 Pink feather Baby cot 2002-01-20 7000 20

3 Dolphin Baby cot 2002-02-19 9500 20

4 Decent Office table 2002-02-01 25000 20

Prepared & Compiled by Alpana Saxena

Page 47: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

53

5 Comfort zone Double bed 2002-02-12 25000 30

6 Donald Baby cot 2002-02-24 6500 25

7 Royal finish Office table 2002-02-20 18000 15

8 Royal tiger sofa 2002-02-22 31000 30

9 Econo sitting sofa 2002-02-13 9500 30

10 Eating Paradise

Dining 2002-02-19 11500 25

a) Show all the information about the baby cots from the FURNITURE table:_____________________________________________________________

b) List the Names which are priced at more than 15000 from the furniture table_____________________________________________________________

c) List names & type of those items, in which Dateofstock is before 2002-02-01 from the table in descending order of names._____________________________________________________________

d) Display names and Dateofstock of those items, in which the discount percentage is more than 25 from table.____________________________________________________

e) Count the number of names whose type is “Sofa” from furniture table.______________________________________________________________

f) Count the no. of names in each type and display it._______________________________________________________________

g) Display the total price of each type._______________________________________________________________

h) Add a column called total (price*discount).______________________________________________________________

Prepared & Compiled by Alpana Saxena

Page 48: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

54

i) Display minimum price, maximum price, average price of the type sofa,baby cot and office table .____________________________________________________________________

Q.2 Predict the output of the queries by considering the table given below: STUDENTS

Admno Name Class Section Phone

1237 Utkarsh 12 A 45372145

1328 Naresh 10 C 43112000

1267 Sumedha 10 B 53428119

1345 Varun 12 C 32476219

1434 David 11 A NULL

1461 Mohini 12 B NULL

1) Select class,section.count(*) from students group by class;2) Select name,section,count(*) from students group by section;3) Select name,phone from students where class=’10’;4) Select count(*) from students group by section;5) Select phone,name from students where phone=’null’;

Q.3 Consider the two tables given below & write the queries for the following: ITEMS

I_code Name Category Rate

1001 Masala dosa South Indian 60

1002 Vada sambhar South Indian 40

1003 Idli sambhar South Indian 40

1004 Chow mein Chineese 80

2001 Dim sum Chineese 60

2002 Soup Chineese 70

Prepared & Compiled by Alpana Saxena

Page 49: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

55

3001 Pizza Italian 240

BILLS

Billno Date I_code qty

1 2010-04-01 1001 2

1 2010-04-01 1002 1

2 2010-04-02 1003 3

2 2010-04-02 1004 1

3 2010-04-02 2001 4

4 2010-04-03 2002 3

5 2010-04-03 3001 2

5 2010-04-03 2001 4

5 2010-04-03 1003 3

1) Display the average rate of South Indian items2) Display the no. of items in each category3) Display the total quantity sold for each item.4) Display total qty of each item sold ,Don’t display the data whose total qty is

less than 3.5) Display the details of bill records along with name of each corresponding

item.6) Display the details of the bill records for which the item is ‘Dosa’.7) Display the bill records for each Italian item sold.8) Display the total value of items sold for each bill.

*************

Prepared & Compiled by Alpana Saxena

Page 50: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

56

Worksheet 20

Q.1 Define: 1) Access Specifiers: ___________________________________________________________________________ __________________________________________________________________________

2) Keyword Static: ___________________________________________________________________________ ___________________________________________________________________________

Prepared & Compiled by Alpana Saxena

Page 51: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

57

3) Public __________________________________________________________________________ ___________________________________________________________________________ 4) Private ___________________________________________________________________________

___________________________________________________________________________

5) Java Libraries ___________________________________________________________________________

___________________________________________________________________________ 6) Keyword ‘This’ ___________________________________________________________________________

___________________________________________________________________________

7) Keyword ‘Static’ ___________________________________________________________________________ ___________________________________________________________________________ 8) Keyword ‘Final’ ___________________________________________________________________________ ___________________________________________________________________________

Q.2 Write functions of the packages given below: 1) Java.applet ___________________________________________ 2) java.awt ___________________________________ __________

Prepared & Compiled by Alpana Saxena

Page 52: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

58

3) Java.io _______________________________________________ 4) Java. Lang ______________________________________________ 5) Java.net _______________________________________________ 6) Java.util _______________________________________________ Q.3 1) What is friendly access of class members? ________________________________________________________________________ ________________________________________________________________________ 3) Differentiate between equals ( ) and equalsIgnorecase ( ) string functions? ________________________________________________________________________ ________________________________________________________________________ 4) Which command creates a package in Java? ________________________________________________________________________

5) Write a program in Java to accept a string & reverse it. 6) Write a program to display date & calendar on your frame.

Prepared & Compiled by Alpana Saxena

Page 53: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

59

********************

Worksheet 21

Q1. a) Write one disadvantage of the following topologies in network

i) Bus Topologies ________________________________________________________________________

Prepared & Compiled by Alpana Saxena

Page 54: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

60

(ii) Star Topologies ________________________________________________________________________

b) Explain in brief of networking needs and goals.

________________________________________________________________________

c) Name two encodings used for Indian Language computing?

________________________________________________________________________

d) Define the following terms: (i)Hub: ________________________________________________________________________ ________________________________________________________________________ (ii) Switch: _______________________________________________________________________

_______________________________________________________________________

Q2. (a)What is the name of event listener interface for action events?

_______________________________________________________________________

_______________________________________________________________________

(b)What does getpassword () on a password field return?

Prepared & Compiled by Alpana Saxena

Page 55: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

61

_______________________________________________________________________

(c) What is inheritance ? Name its various forms. _______________________________________________________________________

_______________________________________________________________________

Q3 .a) Differentiate between CHAR and VARCHAR _______________________________________________________________________

_______________________________________________________________________

Q4. Read the following case study and answer the questions that follow:

1) Write the Code to disable the text fields AmountTF, DiscountTF And NetTF.

2) Write the code for CalcBTN to calculate the amount, discount and net amount as per the given description and conditions

3) Write the code to remove the decimal part from the text field NetTF so that the net amount contains only the integer portion in rupees. Where (in which event handler) would you place this code to have its impact?

4) Write the code for ExitBTN to close the application, but before the application in closed it should check the net amount and if the net amount >10000 the membership of the customer should be upgraded and displayed. For example if the customer already has silver membership it should be upgraded to gold and he should be informed of the same using a message box.

Prepared & Compiled by Alpana Saxena

Page 56: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

62

Q5 (a). Given the following code fragment:

If(a==0)

System.out.println (“zero”);

If(a==1)

System.out.println (“one”);

If(a==2)

System.out.println (“two”);

If(a==3)

System.out.println (“three”);

Write an alternative code (Using if) that saves on number of comparisons.

(b). What will be the output produced by following code fragment?

Float x=9;

Float y=5;

Int z= (int) (x/y);

Switch (z) {

Case1: x=x+2;

Case2: x=x+3;

Default:x =x+1;}

System.out.println (“value of x:”+x);

(c).Find out errors if any:

M=1;

N=0;

For (; m+n<19;++n)

System.out.println (“hello”);

M=m+10;

Prepared & Compiled by Alpana Saxena

Page 57: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

63

(d). Predict the output of the following code fragments:

Int I, j, n;

N=0; i=1;

Do

{N++;

I++;}

While (i<=5);

**********

Worksheet 22

Q.1 Write HTML code to produce these controls Prepared & Compiled by Alpana Saxena

Page 58: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

64

1) a text box with 10 rows and 30 columns ______________________________________________________________________

2) a password text box ______________________________________________________________________

Q.2 a) Explain term function overloading along with an example

___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

b) What are three transaction control statements n MySQL? Give example?

___________________________________________________________________________

___________________________________________________________________________

___________________________________________________________________________

(c) Consider the table HOSPITAL given below. Write command in SQL for following questions-

i) To show all information about the patients of cardiology department.

ii) To list the names of female patients who are in orthopedic department.

iii) To display Patient’s name, charges, age for only male patients

iv) To count the number of patients with age>30.

NO. NAME Age Department Dateofadm Charges Sex

1 Tarun 12 Surgery 01/01/98 300 M

2 Zubin 36 Orthopedic 12/01/98 250 F

3 Ankita 16 Orthopedic 24/02/98 300 F

Prepared & Compiled by Alpana Saxena

Page 59: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

65

Q3.(a) Write an SQL command for creating a table student who structures given below

Field Name Data type Size Constraint

Rno Number 3 Primary key

Class Varchar 5 Not Null

Percentage Number 5,2 Not Null

(b) Given the following teacher relation: Write SQL commands for question. Teacher Table

No. Name Department DateofJoining Salary Sex

1 Raja Computer 21-5-98 8000 M

2 Sangeeta History 21-5-97 9000 F

3 Ritu Sociology 29-8-98 8000 F

1) Show the list of Computer and history department.

2) To list the name of female in History department.

3) To list all names of teacher with date of admission in ascending order.

4) To display Teachers name, department and salary of female teachers.

**************

Worksheet 23

Prepared & Compiled by Alpana Saxena

Page 60: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

66

Section (A)1) Answer the following questions:

a) What is the difference between Star Topology and Bus Topology of network? 2b) What is the full form of the following 2

iii)FTP ii) FSF iii) GNU iv) FLOSSc) What to you understand by Domain resolution? 2d) Why network security is an important aspect over data security 2e) Explain the following terms: 2

i) Linux ii) OSS2) (a) What is e-Learning? 1

(b) What is database connectivity? 1(b) You want to develop an interface for entering your Roll_no, Name, Age and Sex (male or

female). Suggest suitable front-end interface tools in NetBeans IDE.2

(c) Differentiate between front-end and back-end. 2(d) Acme Education has set up its new branch at Jaipur for its office and web based activities. It has 4 wings

of buildings as shown in the diagram:

Center to

center distances between various blocks Number of computers

(i) Suggest the most suitable place for Repeater and switch and justify. (ii) Suggest the most suitable place to house the server. (iii) Suggest the most suitable cable layout and topology between various wings.

Section (B)3. (a) What will be the output of the following program code when the user will press JButton: 2

Public class svm{ int a;

svm(int p){ a=p; }void assign(int no){ a=no; }

Prepared & Compiled by Alpana Saxena

Wing YWin

g X

Wing Z

Wing U

Wing X to Wing Z 50 m Wing X 50Wing Z to Wing Y 70 m Wing Z 30Wing Y to Wing X 125 m Wing Y 150Wing Y to Wing U 80 m Wing U 15Wing X to Wing U 175 mWing Z to Wing U 90 m

Page 61: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

67

int disp(){ return a; }

} private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {

svm os=new svm(15);System.out.println (“ “ + os.disp ());os.assign (35);System.out.println (“ “ + os.disp ());

}(b) Rewrite the following if-else segment using switch-case statement 2 Char ch='A'; if(ch=='A') System.out.println ("Account"); if((ch=='C') || (ch=='G')) System.out.println ("Admin"); if(ch=='F') System.out.println ("Advisor");

(c) What is Dialog box? 1(d) Explain the Resultset. 2(e) In the Design Area, describe the process of setting, two components to the same width. 2(f) (i) What are the general rules of declare XML element. 2

(ii) Write HTML code for the following page: 2

ProductionMr. Ajay 1389Mr. S.N. Krishna 1566Mrs. Arti Singh 1722

SalesMr. Alok 2244Mrs. Poonam 4533Ms. Anita Sharma 5638

(g) (i) Write the HTML code line to set the BGCOLOR as YELLOW. 2(ii) What do you understand by option VLINK used with <BODY> tag?

4. Create a java desktop application to find the area of circle, rectangle, circumference of circle and area of square.

Prepared & Compiled by Alpana Saxena

Page 62: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

68

Formula to calculate various things areArea Circumference/Perimeter

Circle Rectangle Square Circle Rectangle SquareL x B Side2 2L + 2B 4xSide

Control Type Control NameJpanel JPanel1, JPanel2,JtextField JTxtlength, JTxtbreath, JTxtradius, JTxtside,Button JBtnCalculateJradioButton Jrbcircle, Jrbrectangle, JrbsquareJcheckBox Jchkarea, Jchkperimeter, JchkcircumferenceJlabel Jlblresult

(b) Write the code for respective radiobutton to make available the display textbox control, which are appropriate for different object (Circle, Rectangle, Square) operation. 2

(c) Write the code for calculate button to calculate the desired operation which you choose from radio button and check box 3

(Section C)5. (a) Differentiate between CREATE TABLE and DROP TABLE in SQL. 2

(b) What do you mean by attribute? Explain with an example. 2(c) What is transaction? Which statement is used to disable or enable the transaction? 2 (d) What is the difference between Cartesian product and join? 2(e) Name the clauses for the following: 2

(i) To display the record in specified range.(ii) To display the record according to the given pattern

6 Write SQL commands for the statements (i) to (vi) and give outputs for SQL queries (vii) to (x) on

the basis of the table Shop. 10Table: Shop

Prepared & Compiled by Alpana Saxena

Page 63: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

69

No. Shop_name Sale Area Cust_percent Rating City1 West side 250000 West 68.6 C Delhi2 Pantaloons 500000 South 81.8 A Chennai3 Sir’s & Her’s 300000 North 79.8 B Amritsar4 Sports king 380000 North 88.0 B Baroda5 Biswas stores 456000 East 92.0 A Delhi6 Big Bazar 290000 South 66.7 A Kolkota

(i) To display the name of all shops which are in Area South and sale more than average sales.(ii) To display name and Customer Percentage of all the shops having cust_percentage between

77 and 90.(iii) To display list of all the shops with minimum sales, in ascending order of shop name.(iv) To display the city along with sum of sale for each city.(v) To display all the columns where rating is A in the descending order of area;(vi) To display all the Area where more than one shop is there.(vii) Select min(sale) from SHOP where Sale>300000 Group by Sales;(viii)Select Count(Distinct City ) from Shop;(ix) Select Avg(Sale) from Shop where Area=’South’;(x) Select Avg(Cust_percentage), sum(sale) from shop where Rating=’A’;

1. (a) Write the SQL command to create the TEACHER and DEPARTMENT tables including its constraints. 2

Table : TEACHERColumn Name Data Type Size ConstraintTNOTNAMETADDRESSSALARYDEPT_NODOJ

CHARVARCHARVARCHARDOUBLECHARDATE

420257,24

PRIMARY KEY

Table DEPARTMENTColumn Name Data Type Size ConstraintDEPT_NODEPTNAME

CHARVARCHAR

410

PRIMARY KEY

(b) Write the resulting output of the following: 2(i) SELECT SUBSTR(TRIM(‘ HELLO HOW*******ARE YOU’),5,14);(ii) SELECT FLOOR(65467.8890) + R0UND(1234.88, 1);(iii) SELECT MOD(14*9,90/9);(iv) SELECT SUBSTR(UPPER(SUBSTR(‘God is great’,2,8)),2);

(c)Study the following table TEACHER and SALARY and write the SQL commands for the questions (i) and (ii) and give outputs for SQL queries (iii) and (iv)

Table: TEACHERSID NAME DEPT SEX EXPERIENCE101 Siddharth Computer M 12104 Raghav Physics M 5107 Naman Chemistry M 10114 Nupur Computer F 3109 Janvi Physics F 9105 Rama Accounts M 10

Prepared & Compiled by Alpana Saxena

Page 64: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

70

117 James Computer F 3111 Binoy Accounts F 12130 Samuel Computer M 15

Table : SALARYSID BASIC ALLOWANCE DA101 12000 1000 300104 23000 2300 500107 32000 4000 500114 12000 5200 1000109 42000 1700 200105 18900 1690 300130 21700 2600 300

(i) Display NAME and DA of all staff who are in Accounts department and having more than 10 years of experience and DA is more than 300. 2

(ii)Display the NAME and salary of all staff working in physics department and salary more than average salary. (SALARY=BASIC +ALLOWANCE+ DA) 2

(iii) Select NAME, DA, BASIC from TEACHER, SALARYWhere BASIC>20000 and TEACHER.SID=SALARY.SID; 1

(iv) Select NAME, DEPT, SEX, BASIC, DA from TEACHER, SALARYWhere DEPT LIKE ‘%o%’ and DA >=500 and TEACHER.SID=SALARY.SID; 1

***************

Prepared & Compiled by Alpana Saxena

Page 65: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

71

Worksheet 24

Q.1 a) Mr. Vasu is transferring data to a large distance via cable connection and he wants To amplify the Signal transmitting over a network. What device will be useful for Him? b) What type of network would you suggest for the following type of requirements in

an organization? i)Around 200 computers in two different buildings adjacent to one another are to be connected

ii) The cost of network should not be very high. iii) It should be fairly easy to implement. c) Distinguish between Free software & Shareware? d) Arrange the following communication channels in ascending order of their data transmission rates. Ethernet Cable, Optical fiber, Telephone Cable, Coaxial Cable. e) State one example of microwave transmission? f) Which of the following is not a transmission medium?

i) Telephone Lines ii) Coaxial Cable iii) Modem iv) Microwave Systems g) Which of the following technologies require line-of site between the transmitter and receiver ? a) Satellite b) Fiber Optic c) Microwave d) Co-axial Cable h) Identify domain name & URL from the following? http://www.helpingeachother.in/home/aboutus.htm

Q.2 a) Define Super class & Subclass?

b) Write an HTML command to display the following in your Web Page.X2+Y2

c) If R1 is a relation with 5 rows & R2 is a relation with 3 rows, how many rows will the Cartesian product of R1 & R2 have? d) What is the output of the following coding?

double Number = 7583241; int Firsr = 0, Second = 0, R;do

{R = Number % 10;if ( R % 2 == 0 )

First += R;else

Second += R;Number = Number / 10;

} while (Number > 0);System.out.print (First – Second );

Prepared & Compiled by Alpana Saxena

Page 66: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

72

f) Write a JAVA code that takes the cost of a pencil from jTextField1 and number ofPencils from JTextField2 and calculate total amount as cost*number to be displayed in JTextField3 and also find \

20% service tax out of total amount in jTextField4.g) Write a method in java which takes the parameter as string and print the second last

Character?h) How many times will the following loops execute? Which one of these is an entry

Control loop and which one is an exit control loop? Loop 1 Loop 2

int sum=0 ,i=5 ;do{ sum+=i; i++;}while(i<5)

int sum=0,i=5;while(i<5){ sum+=1;i++;}

Q.3a) Write HTML code to produce these controls.

i) A comboboxii) A Text Area with 10 rows and 30 columns.

b) Raja is not able to enter a duplicate value in a column what constraint had he specified While creaing the table

c) Differentiate between UPDATE and ALTER commands with examples d) When creating a table “Customer” Raj forgot to add a column “City”. Give the statement which he should write to add the column into the table. Table “Customer” is already created?

d) What is the difference between a WHERE clause and an HAVING clause of SQL SELECT statement .

e) A table “Stock” in a database has 5 columns & contains 17 records.What is the degree & cardinality of this table?

g) Which keyword is used to make a sub class?

i) Room_No, Cust_Name, Room Type and Room Rent of table “HOTEL” are given

Table : HOTELRoom_No Cust_Name Room_Type Room_Rent204 Rajesh Single 700308 Anuja Double AC 1600105 Vinamra Single NAC 1000202 Soma Double AC 1600206 Jack Single 700

Based on this information, find output of the following queries: a) SELECT Room Type, SUM (Room Rent) FROM hotel GROUP BY Room Type; b) SELECT Room_no FROM hotel WHERE Cust_Name LIKE ‘%n%; Q.4 a) A phone number consisting of 10 digits, is stored in a string variable .Now it is Required to store this phone number in a Long type variable .Write a Java statement To do this ? Prepared & Compiled by Alpana Saxena

Page 67: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

73

b) What will be the contents of jTextField1 and jTextField2 after executing code:-String Board=”CBSE”;String str=”Informatic Practices”;String str1=”NetBeans IDE Programming”;jTextField1.setText (Board.concat (str));jTextField2.setText (str1.substring (9, 13))

c) The following code has some error(s).Rewrite the correct code underlining all the Corrections made?

1) : 2) m=1; f=1; n=0, for (int a=40;(a);a--) for(;m+n<19;++n) f*=a; system.out.println(“hello\n”); : s=0: for (int a = 1; a <40/a++) m=m+10; s+= a; ****************

Prepared & Compiled by Alpana Saxena

Page 68: WordPress.com€¦  · Web viewJava Net beans III Wipro. Open office. Q.5 Write HTML codes for: Production N.N Reddy 1493 S M Krishna 3829 P. Chidambaram 0283 Sales Maria Philip

74

Prepared & Compiled by Alpana Saxena