P. 1
w

w

|Views: 1|Likes:
Published by Kailash Sharma

More info:

Published by: Kailash Sharma on Feb 02, 2013
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as DOCX, PDF, TXT or read online from Scribd
See more
See less

02/21/2013

pdf

text

original

Part A

1. The Form is designed in the a) Inspector window b) Design window c) Palette window d) Properties window 2. The Swing Controls components are contained in the a) Design window b) Inspector window c) Properties window d) Palette window 3. The most suitable component to accept multiline text is: a) Text Field b) Password Field c) Text Area d) All of the above Q1. Multiple choice questions : 4. What will be the output of the following command? Learning.concat("Java") a) Learning Java b) LearningJava c) JavaLearning d) Java Learning e) Will result in an error 5. What will be the output of the following command? "Learning".concat("Java") a) Learning Java b) LearningJava c) JavaLearning d) Java Learning

Part B
Q1 Explain the following terms: a) IDE b) Inspector Window c) Form Q2. Explain the usage of the following methods with the help of an example: a) setText() b) toString() c) concat() d) Q3. Differentiate between: a) Text field and Text area components b) Text field and Password field components c) parseInt() and parseDouble() methods d) Design and Source tabs e)System.out.print() and System.out.println() method.

Part C

WORK SHEET (for Theory & Practical) - CLASS XII SUB : IP

. a) (i)…………………………………………………………………………………………………………………………………………………………………. a) Write the purpose of the following statements: (i) int n=Integer.j=2. for(i=1.setText(st.8)). substring(4. do { y=3.j+=2) System. Ans1.j.println(“Finished!!!”).doClick( ). jTextField2.setText(st.parseInt(“1254”).i++.p. (ii) jButton1. System. Ans d) . while(y>1) Ans c) d) What will be the content of jTextField1 and jTextField2 after executing the following code: String st=”New to Information Technology”.println(i++).substring(7)).out. if p=2 System.TOPIC : JAVA GUI PROGRAMMING (Revision Tour) Name and House No…………………………………………………………………………………………………………. Rewrite the correct code underlining all the corrections made. (ii) …………………………………………………………………………………………………………………………………………………………………………… b) Rewrite the following code using while loop: Ans b) int i. Q1.print(“Two”). p=y%10.i<=6. c) The following code has some error(s). int y=6.14*y. jTextField1.out.out.

. System. (b) What will be the output produced by following code fragment? flaot x=9.………………………………………………………………… Ans d)……………………………………………. i++.j.out. n=0. m=m+10. if(a==2) System.i=1.TOPIC : JAVA GUI PROGRAMMING (Revision Tour) Name and House No…………………………………………………………………………………………………………. Q2.++n) System. Ana c) (d) Predict the output of the following code fragments: int i..out.println(“i= ”+i+” n = “ +n). if(a==1) System. int z=(int)(x/y). (c) Find out errors if any: m=1.println(“value of x:”+x).println(“three”).out.m+n<19. } System. (a) Given the following code fragment : if(a==0) System. for(.println(“zero”).n. } while(i<=5). Ans b)…………………………………………….. if(a==3) System. float y=5. (a) Write an alternative code (Using if) that saves on number of comparisons.out.………………………………………………………………… .out. Ans 2.println(“one”).println(“hello”). switch(z) { case1:x=x+2.println(“two”). default:x =x+1.out.out. do { n++. n=0. case2: x=x+3.

170/. check box should be deselected.day. b) When Clear button is clicked. Mr. d) Design a GUI desktop application in java to accept temperature in Celsius in a text field and display temperature in Fahrenheit in another text field on the click of a button. The application must have an exit button to end the application and appropriate labels. Skilled labourers are paid extra at the rate of Rs. c) Design a GUI desktop application in java to accept weight in Kilograms in a text field and convert it into grams and milligrams on the click of two separate buttons. The application must have an exit button to end the application and appropriate labels. The application must have an exit button to end the application and appropriate labels. Write the code to lock the text box. . Write code to do the followinga) When Calculate Wage button is clicked. Male and female labourers are respectively paid Rs. To calculate total wages he has developed the following GUI in NetBeans. Male and female labourers from rural areas are paid 10% less per day. Display the result in a second text field. all the text boxes should be cleared and radio button.per day and Rs. The application must have an exit button to end the application and appropriate labels. Madhav works in a construction company. c) Close the application when Quit button is pressed. 100/. Practial based exercise a) Design a GUI desktop application in java to accept the name and favourite sport in two text fields and display an appropriate message including the name and favourite sport in a dialog box using the concat() method. b) Design a GUI desktop application in java to accept age category using radio buttons and display an appropriate age based message in a text area on selection of a radio button.per day. 150/. the total wages is calculated as per the given criteria and displayed in total wage text box. I.( text box for total wages should not take input) II.Q3.

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->