Sample PapersICSEClass 10Computer Applications

ICSE Class 10 Computer Applications Model Papers with Java Programs

Two ICSE Class 10 Computer Applications model examination papers with Java programming questions on wrapper classes, arrays, searching, sorting and strings, plus a programming class test with a solved example. Free PDF download.

8 min read
ICSE Class 10 Computer Applications Model Papers with Java Programs

These papers give you practice with the second half of the ICSE Class 10 Computer Applications syllabus: wrapper classes, arrays, searching and sorting, and String handling. Questions on these chapters make up most of Section B in the board exam. The papers were set by Trushna Tejwani for her Class 10 students.

Papers included

  1. Model Examination 2 (50 marks, 1½ hours): Section A has 10 MCQs on wrapper classes, arrays and strings. In Section B you attempt any four programs.
  2. Model Examination 5 (50 marks): MCQs on non-primitive types, access specifiers, parseByte() and Character methods, followed by programming questions on arrays, binary search and strings.
  3. Programming class test (25 marks, 35 minutes): a short test with one method-based program and one class-design program, Taximeter, which calculates a fare from a rate table.

Worked example from the class test

Q. Write a method to find the smallest digit of an integer entered by the user. Sample input 6524 gives the output Smallest digit is 2.

import java.util.Scanner;

class SmallestDigit {
    int smallest(int n) {
        n = Math.abs(n);
        int min = 9;
        do {
            int d = n % 10;
            if (d < min)
                min = d;
            n = n / 10;
        } while (n > 0);
        return min;
    }

    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
        System.out.print("Enter an integer: ");
        int num = sc.nextInt();
        SmallestDigit ob = new SmallestDigit();
        System.out.println("Smallest digit is " + ob.smallest(num));
    }
}

Why a do-while loop? It runs at least once, so the input 0 correctly gives 0. Starting min at 9 works because no digit can be larger than 9.

Quick revision: wrapper classes

  • A wrapper class converts a primitive into an object, for example int to Integer and char to Character.
  • Integer.parseInt("25") returns the int 25, and Byte.parseByte("12") returns a byte.
  • Useful Character methods: Character.isDigit(), isLetter(), isUpperCase(), toUpperCase() and isWhitespace().
  • private is the most restrictive access specifier; public is the least restrictive.

How to use these papers

  1. Attempt Section A in about 10 minutes.
  2. Choose the four programs you are most confident about, and write each one completely with variable descriptions.
  3. Type your programs into BlueJ and test them with the sample inputs given in the question.

For more practice, see our 10 most important String programs for ICSE Class 10 and the solved ICSE Class 10 Sample Paper 2027.

Download the papers

ICSE Class 10 Model Examination 2

PDF · 125 KB

Download PDF

ICSE Class 10 Model Examination 5

PDF · 234 KB

Download PDF

ICSE Class 10 Programming Class Test

PDF · 236 KB

Download PDF
Read the questions as text
ICSE Class 10 Model Examination 2 ICSE SEMESTER 2 MODEL EXAMINATION-2 COMPUTER APPLICATIONS Maximum Marks : 50 Time allowed: One and a half hours Answer to this paper must be written on the paper provided separately. You will not be allowed to write during the first 10 minutes This time is to be spent in reading the question paper. The time given at the head of this paper is the time allowed for writing the answers. Attempt all questions from section A and any four questions from Section B. SECTION - A (10 Marks) (Attempt all questions) Choose the correct answers to the questions from the given options.( Do not copy the question, write the correct answer only) Question 1 i. A wrapper converts a. int to float a) float to int b) String to StringBuffer c) Primitive datatype to object ii. ____________ and _______________ are the numeric wrapper classes in java a) String and Integer b) Byte and Short c) Int and Byte d) Int and Float iii. If we convert a short datatype to a Short wrapper class object the process is called a) Typecasting b) Coercion c) Pointing d) Boxing iv. Write the output System.out.println(Character.isLetter(‘a’)&&Character.isUpperCase(‘t’) ); a. true b. false c. aT d. trueT v. ______________is a method of a class which can access only static data members a. instance b. static method c. class method d. both b and c vi. Which of the following is/are not valid array declaration a. int a[]=new int[10]; b. int []a=new int[10]; c. int a{ }=new int[10]; d. int a[]={1,2,3,4}; vii. Which of the following is not an advantage of array a. Code optimisation b. Random Access c. Fixed size d. Both a and b viii. Given a string str=”Software and Hardware”; The return type of str.length()+str.indexOf(‘w’) will be a. int b. float c. double d. byte ix. String str=”ExaminationsOnlineTerm1”; System.out.println(str.substring(4,9)+str.indexOf(‘T’)+str.lastIndexOf(‘ m’); a. inati1831 b. inti1821 c. inat1821 d. inati1821 x. The parameters to a function have a a. Local scope b. Global scope c. Class scope d. None of these SECTION B (40 Marks) (Attempt any four questions) Question 2 Write a program to accept a string. Convert the string to uppercase. Count and output the number of double letter sequences that exist in the string Sample Input: “SHE WAS FEEDING THE LITTLE RABBIT WITH AN APPLE” Sample output: 4 Question 3 Write a program in java to search a given integer array for the presence of a particular element using binary search technique. Question 4 Define a class in java accept and store 10 strings into the array and print the strings with odd number of characters. Question 5 Write a program to input a sentence. Convert the sentence into uppercase letters. Display the words along with the frequency of the words which have atleast a pair of consecutive letters. Sample Input: MODEM IS AN ELECTRONIC DEVICE Sample Output: MODEM DEVICE Question 6 Write a program to input a sentence and print the number of characters found in the longest word of the given sentence. For eg: if S=”India is my country” then the output should be 7 Question 7 Write a program to read into the computer a line of text containing both uppercase letters, lowercase letters, space and special characters. Write out the text with the uppercase and lowercase letters reversed, but all other characters intact. Example: Input: Work Hard and Success will Surely be Yours. Output: wORK hARD AND sUCCESS WILL sURELY BE yOURS. ―――――――――― ICSE Class 10 Model Examination 5 _______________________________________________________________________________________ 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 (Attempt all questions.) Question 1 Choose the correct answers to the questions from the given options. (Do not copy the question, Write the correct answer only.) [10] (i) Identify the non-primitive data type from the following: (a) Math (b) int (c) Scanner (d) Both (a) and (c) (ii) Which one is the most restrictive access specifier ? (a) public (b) private (c) protected (d) Default access specifier 1 (iii) The return data type of parseByte( ) method is ________ . (a) Integer (b) byte (c) String (d) Byte (iv) Name the method of Character class that checks whether a character given as argument is a white space or not. (a) isWhiteSpace( ) (b) isSpace( ) (c) hasWhiteSpace( ) (d) hasSpace( ) (v) Predict the output of the following statement: int X[ ] = {8, 5, 0, 1, 3}; System.out.println(X.length + Math.pow(X[1], X[2])); (a) 5 (b) 6 (c) 5.0 (d) 6.0 (vi) Predict the output of the following statement. System.out.println("PROGRAMS".compareTo("PROGRAM")); (a) 0 (b) 83 (c) 1 (d) -83 (vii) protected int value = 25; This instance variable can be accessed from ______________ . (a) Any class defined in any package (b) Only the subclasses defined in any package (c) Only the same class (d) Other classes in the same package and subclasses of same package as well as different package 2 (viii) What is the data type of the argument given in startsWith( ) method of String class ? (a) char (b) boolean (c) String (d) No argument is provided (ix) State the output of the following code fragment: int c[ ] = {20, 74, 32, 10, 9, 87, 52, 37}; int p = c[c.length - 1]; int q = c[p%c[2]]; System.out.print(p+ "," +q); (a) 74, 32 (b) 37, 87 (c) 10, 9 (d) 52, 37 (x) What will be the output generated by the following statement ? System.out.print("Discovery".substring("Roboto".indexOf('o'), 5) ; (a) A runtime error will be encountered (b) A null string (c) very (d) isco SECTION B (Attempt any four questions.) Flow-Charts and Algorithms are not required. Variable Description is mandatory. Question 2 [10] Define a class to input a word in lower case. Find and display the following: • The letter with the highest ASCII value • The letter with the lowest ASCII value 3 Question 3 [10] Define a class to declare an array to store 10 decimal values of double type and display all the values after removing their fractional part. Example: Sample Input: 1.5, 5.7, 4.78, 8.9, 5.7, 23.7, 3.05, 7.37, 12.3, 6.8 Sample Output: 1, 5, 4, 8, 5, 23, 3, 7, 12, 6 Question 4 [10] Define a class to declare an array that can accept 20 integers from the user. Now calculate the average of the numbers and display the numbers greater than the average as well as smaller than the average separately with proper messages. Question 5 [10] Define a class to accept a line of string containing multiple words. Now eliminate the last word and display the modified string. Example: Sample Input: I have a lot of books pens Sample Output: I have a lot of books Question 6 [10] Define a class to accept a string containing 20 digits without any space character from the user and declare an integer array to store 10 double-digit numbers extracted sequentially from the left-hand side of the input string. Now ask the user to enter an element to search in the array using the technique of Linear search and if the element is found, display the number and its position in the array, otherwise display the message “ELEMENT NOT FOUND” (assume that, position = index + 1). Question 7 [10] Define a class to accept 30 words in upper case in a String array and print only those words that starts with ‘C’ and ends with ‘E’. 4 ―――――――――― ICSE Class 10 Programming Class Test SUB: COMPUTER FOR CLASS X TIME: 35 min SNV International School, Nadiad Schedule test – 3 DATE: 31/7/17 MARKS: 25 Question 1. [10] Write a program to make a function to find the smallest digit of an integer that is input by the user. Sample input : 6524 Sample output : Smallest digit is 2 Question 2. [15] Define a class Taximeter having the following description: Data members/instance variables int taxino - to store taxi number String name - to store passenger's name int km - to store number of kilometres travelled Member functions: Taximeter()- default constructor to assign default values to the data member. Taximeter (int tno, String nm, int k) - to store taxino ,name, km calculate() - to calculate bill for a customer according to given conditions Kilometers travelled(km) Rate/km ≤ 1 km Rs 25 1 < km ≤ 6 Rs 10 6 < km ≤ 12 Rs 15 12 < km ≤ 18 Rs 20 >18 km Rs 25 display()- To display the details in the following format Taxino Name Kilometres travelled Bill amount - - - - Create an object in the main method and call all the above methods in it.