802_INFORMATION_TECHNOLOGY- Class 11
802_INFORMATION_TECHNOLOGY- Class 11
Information technology
CLASS: XI Max Marks: 30
Date : Max.Time : 1 ½ hrs
General Instructions:
A. The program has compile errors because the variable radius is not initialized.
B. The program has a compile error because a constant PI is defined inside a
method.
C. The program has no compile errors but will get a runtime error because radius
is not initialized.
D. The program compiles and runs fine.
Analyze the following code:
A. The program has compile errors because the variable radius is not initialized.
B. The program has a compile error because a constant PI is defined inside a
method.
C. The program has no compile errors but will get a runtime error because radius
is not initialized.
D. The program compiles and runs fine.
Analyze the following code:
A. The program has compile errors because the variable radius is not initialized.
B. The program has a compile error because a constant PI is defined inside a
method.
C. The program has no compile errors but will get a runtime error because radius
is not initialized.
D. The program compiles and runs fine
Analyze the following code
public class Test{
public static void main(String [] args){
double radius;
double PI=3.14;
double area=radius*radius*PI;
System.out.print(" Area is" + area);
}
Pg. 2
}
(a) The program has compile errors because the variable radius is not initialized.
(b) The program has a compile error because a constant PI is defined inside a
method.
(c) The program has no compile errors but will get a runtime error because radius
is not initialized.
(d) The program compiles and runs fine.
Q.6 a.The following code has some errors(s). rewrite the correct code underlying 3
all corrections. Also categorize the loop as entry/exit control loops.
int p
P=14;
do
P= p-2
System. out. display (p);
While(p>=2);
Pg. 3
b. a.what is method?write the structure of java method
Q.7 Give three differences between while loop and do while loop. 3
Q.8 Write a Java Program to calculate simple interest. 3
Q.9 (a) Write a program to calculate the sum of first 10 natural number 2+2
using For loop.
(b) Write a java program to display the details of book by using class
and object.
Q.10 a.Write a program to print the class report card for the five students by using 2+2
Array.
b.Write a program to print the circumference and area of a circle by defining
your own method.
Answer the following questions 4 x2 = 8 marks
Pg. 4