ICSE Class 10 Computer Science Sample Paper

ICSE Class 10 Computer Science Sample Paper. Sample papers and question papers for ICSE and ISC students. These question papers have been collected by the best teachers from ICSE and ISC schools. Students should download and practice these papers to gain better marks in examinations. 

Section A 

Attempt all questions

Q1. (a) Name the four integer data types of Java. 

(b) What is a “ternary operator” of Java? 

(c) What is meant by “nesting of loops”? Give suitable example. 

(d) Differentiate between int and float data type. Give one example for each. 

(e) What is Polymorphism? Give one example.  

Q2. (a) What is meant by “exit controlled loop”? Give one example. 

(b) Differentiate between constructor and finalizer with suitable examples for each. 

(c) What do you understand by the term “Escape Sequence”? Give two example with proper explanation.

(d) Differentiate between data abstraction and data encapsulation  

Q 3. (a) Give the output of the following code snippets: 

       (i) int f = 1, i = 2;

           do {

           f * = i;

           i++;

           }while ( i < 5 );

           System.out.println ( f );

      (ii) int a = 0, p;

           for( int i = 0; i < 5; ++i ) {

           a = a + p * i;

           System.out.println( a );

           }

(b) Find error(s), if any in the following code snippets: 

     (i) int i [][] = {{1, 2}, {3, 4}};

         i [1, 1] = 5;

    (ii) int b[] = new int [10];

         for ( int i = 0; I <= b.length; ++i )

         b[i] = 1;

(c) Create a multidimensional array in which each there are three rows & each row has different numbers of columns: 1st row has three columns, 2nd row has 2 columns and the last row has 4 columns.  

Q4. (a) Write the equivalent do-while loop for the following for loop: 

            for ( ; ; )

            {s; } //s represents any statement

(b) Assume that i = 1, j = 2, k = 3, and m = 2. What does ach of the following statements print? 

     (i) System.out.println ( k + m < j | 3 – j >= k );

     (ii) System.out.println ( ! ( k > m ));

(c) What would happen when the following is compiled and executed? 

     (i) class Example {

          int x, y;

          String name;

          public static void main ( string[] args) {

          Example ex = new Example ();

          System.out.println ( “ex is ’’ + ex.name + “ ” + ex.x + “ ’’ + ex.y);

          }}

      (ii) public class XYZ{

           public static void main(String[ ]args) {

           for ( int i = 0; i < 2; ++i ) {

           for ( int j = 2; j >= 0; j– ) {

           if ( i = = j )

           break;

           System.out.println ( “i = ” + i + “j = ” + j );

           }}}}

Section B 

The answer in this Section should consist of the programs in either BlueJ environment any other program environment or with Java as the base. Each program should be written using Variable Descriptions/Mnemonic Codes such that the logic of the program is clearly depicted. Flow charts and algorithms are not required. 

Q 5. Write an application that inputs a line of text and output the text twice – once in all upper case and once in all lower case letters.

Q 6. Create a class Rectangle that has attributes length & width each of which defaults to 1. It has methods that calculate the perimeter and the area of the rectangle. It has set and get methods for both length and width. The set and get methods should verify that length and width are each floating-point numbers larger than 0.0 and smaller than 20.0. 

Please click below link ICSE Class 10 Computer Science Sample Paper.