III Assessment Class XII
MM: 15
Computer Application Time: 40min
Q1.What will be the output of the following code?
(3)
int a=10 b=15;
For (int i=0,i<6,i++,a++)
a=a+3;
b--;
system .out. println(“a=”+a);
system .out. println(“b=”+b);
Q2.(a) What is the difference between a method and a constructor?
(1)
(b)What is the difference between a break statement and a continue
statement, in a loop. (1)
( c)Name a Java keyword that indicates a method has no return type.
(1)
Q3.Write a Java expression for ut+1/2 ft2
(3)
Q4.What is final value for ctr, when eteration process given below,
executes? (3)
Int ctr=0;
For (int i=0;i<=5;i++);
For (int j=0;j<=5;j+=2);
++ctr;
Q5.Analyze the program segment and determine how many times the
loop will be executed and what will be the output. (3)
int p=200;
while (true)
{
if (p<100) Break;
p=p-20;
System.out.println(p);