# Sample Paper ICSE Class 10 Computer Applications Set B

Students can refer to the following Sample Paper ICSE Class 10 Computer Applications Set B with Answers provided below based on the latest syllabus and examination guidelines issued for ICSE Computer Applications. All specimen papers have been prepared covering all chapters given in ICSE Computer Applications book for Class 10. You should also refer to ICSE Class 10 Computer Applications Solutions.

Sample Paper ICSE Class 10 Computer Applications Set B with Answers

Class: X (TEN) Full Marks: 100
Subject: Computer Application (Theory) Pass Marks: 40

General Instructions
This Paper is divided into two Sections

Attempt all questions from Section A and any four questions from Section B.
The intended marks for questions or parts of questions are given in brackets [].

SECTION A (40 MARKS)
(Attempt all questions)

Question 1.
(a) Define Encapsulation. 
(b) What are keywords ? Give an example. 
(c) Name any two library packages. 
(d) Name the type of error in each case given below: 
(i) Math.sqrt (36 – 45);
(ii) int a;b;c;
(e) If int x [ ] = { 4, 3,7, 8, 9,10}; what are the values of p and q ? 
(i) p = x.length
(ii) q = x + x * x

Question 2.
(a) (i) int res = ‘A’; 
What is the value of res ?
(ii) Name the package that contains wrapper classes.
(b) State the difference between while and do while loop. 
(c) System.out.print(“BEST”); 
System.out.println(“OF LUCK”);

Choose the correct option for the output of the above statements
(i) BEST OF LUCK
(ii) BEST OF LUCK

(d) Write the prototype of a function check which takes an integer as an argument and returns a character. 
(e) Write the return data type of the following function. 
(i) endsWith( )
(ii) log( )

Question 3.
(a) Write a Java expression for the following

(b) What is the value of y after evaluating the expression given below? 
y + = ++y + y – l – y; when int y=8

(c) Give the output of the following : 
(i) Math.floor (- 4.7)
(ii) Math.ceil(3.4) + Math.pow(2,3)

(d) Write two characteristics of a constructor. 

(e) Write the output for the following : 
System.out.println(“Incredible” + “\n” + “world”);
(f) Convert the following if else if construct into switch case 
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”);

(g) Give the output of the following string functions: 
(i) “ACHIEVEMENT” .replace(‘E’, ‘A’);
(ii) “DEDICATE”. compareTo(“DEVOTE”);

(h) Consider the following String array and give the output 
String arr[]= {“DELHI”, “CHENNAI”, “MUMBAI”, “LUCKNOW”, “JAIPUR”};
System.out.println(arr.length( ) > arr.length( ));
System.out.print(arr.substring(0,3));

(i) Rewrite the following using ternary operator : 
if(bill > 10000)
discount = bill * 10.0/100;
else
discount = bill * 5.0/100;

(j) Give the output of the following program segment and also mention how many times the loop is executed : 
int i;
for (i = 5; i > 10; i + +)
System.out.println(i);
System.out.println(i*4);

SECTION B (60 MARKS)
(Attempt any four questions from this Section.)

The answers in this Section should consist of the Programs in either Blue J environment or
any program environment with Java as the base.
Each program should be written using Variable descriptions so that the logic of the
program is clearly depicted.
Flow-Charts and Algorithms are not required.

Question 4. 
Define a class called Library with the following description :

Instance variables/data members :
int acc_num — stores the accession number of the book
String title — stores the title of the book
String author — stores the name of the author

Member methods:
(i) void input ( ) — To input and store the accession number, title and author.
(ii) void compute ( ) — To accept the number of days late, calculate the display fine charged at the rate of Rs. 2 per day.
(iii) void display( ) — To display the details in the following format:

Accession Number Title Author
Write a main method to create an object of the class and call the above member methods.

Question 5. 
Using the switch statement, write a menu driven program for the following:
(i) To print the Floyd’s triangle [Given below]

(ii) To display the following pattern

For an incorrect option, an appropriate error message should be displayed.

Question 6. 
Design a class to overload a function polygon() as follows
(i) void polygon(int n, char ch) — with one integer argument and one character type argument that draws a filled quare of side n using the character stored in ch.
(ii) void polygon(int x, int y) — with two integer arguments that draws a filled rectangle of length x and breadth y, using the symbol ‘@’.
(iii) void polygon( ) — with no argument that draws a filled an angle shown below.

Question 7. 
Write a program to accept a number and check and display whether it is a spy number or not. (A number is spy if the sum of its digits equals the product of its digits.)
Example : consider the number 1124,
Sum of the digits = l + l+ 2 + 4 = 8
Product of the digits = 1×1 x2x4 = 8

Question 8. 
Write a program to accept name and total marks of N number of students in two single subscript array name[] and totalmarks[ ].
Calculate and print:
(i) The average of the total marks obtained by N Number of students.
[average = (sum of total marks of all the students)/N]
(ii) Deviation of each student’s total marks with the average.

Question 9. 
Write a program to input integer elements into an array of size 20 and perform the following operations:
(i) Display largest number from the array.
(ii) Display smallest number from the array.
(iii) Display sum of all the elements of the array.

Question 10. 
Using the switch statement, write a menu driven program to:
(i) Generate and display the first 10 terms of the Fibonacci series 0, 1, 1, 2, 3, 5…..
The first two Fibonacci numbers are 0 and 1, and each subsequent number is the sum of the previous two.
(ii) Find the sum of the digits of an integer that is input.
Sample Input: 15390
Sample Output: Sum of the digits =18
for an incorrect choice, an appropriate error message should be displayed.