(a) Name the following:

ICSE Class 10 Computer Applications PYQ · 2017 Paper · Section A

21 Mark · 2017 · Section A · 2017 Paper

(a) Name the following:

Show SolutionHide Solution↓
  1. import
  2. Array

(b) What are the two ways of invoking functions?

Call by value and call by reference.

(c) State the data type and value of res after the following is executed:

char ch='t';
res= Character.toUpperCase(ch);

Data type of res is char and its value is T.

(d) Give the output of the following program segment and also mention the number of times the loop is executed:

int a,b;
for (a = 6, b = 4; a <= 24; a = a + 6)
{
    if (a%b == 0)
    break;
}
System.out.println(a);

Output of the above code is 12 and loop executes 2 times.

This dry run explains the working of the loop.

abRemarks
641st Iteration
1242nd Iteration

In 2nd iteration, as a%b becomes 0 so break statement is executed and the loop exits. Program control comes to the println statement which prints the output as current value of a which is 12.

(e) Write the output:

char ch = 'F';
int m = ch;
m=m+5;
System.out.println(m + " " + ch);

Output of the above code is:

75 F

The statement int m = ch; assigns the ASCII value of F (which is 70) to variable m. Adding 5 to m makes it 75. In the println statement, the current value of m which is 75 is printed followed by space and then value of ch which is F.

← Previous questionNext question →

Browse the free Computer Applications sample bank