Sample Question No. 4 for IP - Informatics Practices ( AISSCE 2014 ) _ A
[1+1+1+2+2+2+6]
(a) What is Interfaces in Java? What pupose
does it solve?
(b) Differentiate between function
overloading and method overriding.
(c) Write the purpose of the following
statements:
(i) int n = Integer.parseInt(“1254”);
(ii) System.exit(0);
(d) Rewrite the following code using while
loop:
int i,j=15;
for(i=1; i<=6 ;i++)
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) Tina and Payal works in a construction
company. To calculate total wages he has developed the following GUI in
NetBeans.
Male and female laboures are respectively
paid Rs. 200/- per day and Rs. 240/- per day. Skilled labourers are paid extra
at the rate of Rs. 200/- day. Male and female laboures 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.
(c) Close the application when Quit
button is pressed.
