Solved 2018 Question Paper ICSE Class 10 Computer Applications
Solved 2018 Question Paper ICSE Class 10 Computer Applications
Section A
Question 1
Answer
Abstraction refers to the act of representing essential features without including the
background details or explanation.
Answer
Searching Sorting
Searching means to search for a term or value Sorting means to arrange the elements of the array in
in an array. ascending or descending order.
Linear search and Binary search are examples Bubble sort and Selection sort are examples of sorting
of search techniques. techniques.
Answer
isUpperCase( ) toUpperCase( )
(d) How are private members of a class different from public members?
Answer
private members of a class can only be accessed by other member methods of the same class
whereas public members of a class can be accessed by methods of other classes as well.
1. char
2. arrays
3. int
4. classes
Answer
1. Primitive
2. Non-Primitive
3. Primitive
4. Non-Primitive
Question 2
Answer
Value of res is 65 which is the ASCII code of A. As res is an int variable and we are trying to
assign it the character A so through implicit type conversion the ASCII code of A is assigned
to res.
Answer
java.lang
Answer
while do-while
It is helpful in situations where numbers of iterations are It is suitable when we need to display a menu
not known. the user.
Choose the correct option for the output of the above statements
1. BEST OF LUCK
2. BEST
OF LUCK
Answer
(d) Write the prototype of a function check which takes an integer as an argument and
returns a character.
Answer
char check(int a)
1. endsWith()
2. log()
Answer
1. boolean
2. double
Question 3
3x+x2a+ba+b3x+x2
Answer
Math.sqrt(3 * x + x * x) / (a + b)
(b) What is the value of y after evaluating the expression given below?
Answer
⇒ y = 8 + (9 + 9 + 7)
⇒ y = 8 + 25
⇒ y = 33
1. Math.floor (-4.7)
2. Math.ceil(3.4) + Math.pow(2, 3)
Answer
1. -5.0
2. 12.0
Answer
Incredible
world
\n is the escape sequence for newline so Incredible and world are printed on two different
lines.
if( var==1)
System.out.println("good");
else if(var==2)
System.out.println("better");
else if(var==3)
System.out.println("best");
else
System.out.println("invalid");
Answer
switch (var) {
case 1:
System.out.println("good");
break;
case 2:
System.out.println("better");
break;
case 3:
System.out.println("best");
break;
default:
System.out.println("invalid");
}
(g) Give the output of the following string functions:
1. "ACHIEVEMENT".replace('E', 'A')
2. "DEDICATE".compareTo("DEVOTE")
Answer
1. ACHIAVAMANT
2. -18
Explanation
⇒ 68 - 86
ASCII code of D - ASCII code of V
⇒ -18
(h) Consider the following String array and give the output
false
JAI
Explanation
int i;
for ( i = 5 ; i > 10; i ++ )
System.out.println( i );
System.out.println( i * 4 );
Answer
20
Loop executes 0 times.
Explanation
In the loop, i is initialized to 5 but the condition of the loop is i > 10. As 5 is less than 10 so
the condition of the loop is false and it is not executed. There are no curly braces after the
loop which means that the statement System.out.println( i ); is inside the loop and the
statement System.out.println( i * 4 ); is outside the loop. Loop is not executed
4 ); being outside the loop is executed and prints the output as 20 (i * 4 ⇒ 5 * 4 ⇒ 20).
so System.out.println( i ); is not executed but System.out.println( i *
Section B
Question 4
Member methods:
void accept() — To take input for name, coach, mobile number and amount.
void update() — To update the amount as per the coach selected (extra amount to be added in
the amount as follows)
First_AC 700
Second_AC 500
Third_AC 250
sleeper None
void display() — To display all details of a customer such as name, coach, total amount and
mobile number.
Write a main method to create an object of the class and call the above member methods.
Answer
import java.util.Scanner;
Output
Question 5
Write a program to input a number and check and print whether it is a Pronic number or not.
(Pronic number is the number which is the product of two consecutive integers)
Examples:
12 = 3 x 4
20 = 4 x 5
42 = 6 x 7
Answer
import java.util.Scanner;
if (isPronic)
System.out.println(num + " is a pronic number");
else
System.out.println(num + " is not a pronic
number");
}
}
Output
Question 6
Write a program in Java to accept a string in lower case and change the first letter of every
word to upper case. Display the new string.
Sample input: we are in cyber world
Sample output: We Are In Cyber World
Answer
import java.util.Scanner;
System.out.println(word);
}
}
Output
Question 7
1. double volume (double R) – with radius (R) as an argument, returns the volume of
sphere using the formula.
V = 4/3 x 22/7 x R3
2. double volume (double H, double R) – with height(H) and radius(R) as the arguments,
returns the volume of a cylinder using the formula.
V = 22/7 x R2 x H
Answer
Output
Question 8
Write a menu driven program to display the pattern as per user’s choice.
Pattern 1
ABCDE
ABCD
ABC
AB
A
Pattern 2
B
LL
UUU
EEEE
Answer
import java.util.Scanner;
case 2:
String word = "BLUE";
int len = word.length();
for(int i = 0; i < len; i++) {
for(int j = 0; j <= i; j++) {
System.out.print(word.charAt(i));
}
System.out.println();
}
break;
default:
System.out.println("Incorrect choice");
break;
}
}
}
Output
Question 9
Write a program to accept name and total marks of N number of students in two single
subscript array name[] and totalmarks[].
Answer
import java.util.Scanner;
Output