ICSE Class 10 Computer Applications Sample Question Paper 13 with Answers

ICSE Class 10 Computer Applications Sample Question Paper 13 with Answers

Maximum Marks: 50
Time: 2 Hours

Section – A [10 Marks]
Attempt all questions

Question 1.
Choose the correct answers to the questions from the given options. (Do not copy the question, write the coned answer only)
(i) When primitive data type is converted to its corresponding objected of its class. it is called as ……………
(a) Boxing
(b) Explicit type conversion
(c) unboxing
(d) Implicit type conversion
Answer:
(a) Boxing
Explanation:
When primitive data type is converted to its corresponding object of its class, it is called as Boxing.

ICSE Class 10 Computer Applications Sample Question Paper 13 with Answers

(ii) State the value of y after the following is executed:
char x = ’7’;
y = Character, is Letter (x);
(a) false
(b) 7
(c) true
(d) ‘7’
Answer:
(a) false
Explanation:
The variable x stores 7. Hence Character.isLetter(x); returns false into y.

(iii) Give the output of the following string methods:
“MISSISSIPPI ‘.indexOf(‘S’) + “MISSISSIPPI”. tastlndexOf(‘I’)
(a) 10
(b) 12
(c) 20
(d) 11
Answer:
(b) 12
Explanation:
“MISSISSIPPI”.indexOf(‘S’) returns 2, the first index of ‘S’ + “MISSISSIPPI”.lastlndexOf(T) returns 10, the last index of ‘I’ =12

ICSE Class 10 Computer Applications Sample Question Paper 13 with Answers

(iv) Corresponding wrapper class of mt data type is .
(a) integer
(b) INTEGER
(c) Int
(d) Integer
Answer:
(iv) (d) Integer
Explanation:
The Integer is the Wrapper class for the int primitive data type.

(v) Variable that is declared with in the body of a method Is termed as:
(a) Instance variable
(b) class variable
(c) Local vanable
(d) Argument vanable
Answer:
(c) Local variable
Explanation:
Variable that is declared with in the body of a method is called a local variable as they are accessible locally in the scope of the method.

ICSE Class 10 Computer Applications Sample Question Paper 13 with Answers

(vi) Identify the correct array declaration statement.
(a) in a[10]
(b) int a[]=new int[10];
(c) int arr[i]=10;
(d) int a[10]=new int[];
Answer:
(vi) (c) int a[]=new int[10];
Explanation:
While declaring an array the array name along with the new operator and size of the array is to be specified.

(vii) A variable that is bounded to the object it sell is called as:
(a) Instance variable
(b) class variable
(c) Local variable
(d) Argument variable
Answer:
(a) Instance variable
Explanation:
An Instance variable is bounded to the object itself as it carries different values for different objects,

ICSE Class 10 Computer Applications Sample Question Paper 13 with Answers

(viii) The access modifier that gives most accessibility is:
(a) private
(b) public
(c) protected
(d) package
Answer:
(b) public
Explanation:
As the name suggests, the public access specifier creates members that are accessible to all others.

(ix) Give the output of the following code: String A =”26.0″, B=”74.0″;
double C = Double .parseDouble(A);
double D = Double .parseDouble(B); System.out.println((C+D));
(a) 26
(b) 74
(c) 100.0
(d) 2674
Answer:
(c) 100
Explanation:
double C = Double .parseDouble(A); gives C as 74.0
double D = Double .parseDouble(B); gives D as 24.0 C+D gives 100.0

ICSE Class 10 Computer Applications Sample Question Paper 13 with Answers

(x) Wrapper classes are available in package.
(a) java.io
(b) java.util
(c) java.lang
(d) java.awt
Answer:
(c) java.lang
Explanation:
The Wrapper classes in java are available in java.lang package.

Section – B  (40 Marks)
Attempt any four questions

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/Mnemonic Codes such that the logic of the program is clearly depicted. Flow-Charts and Algorithms are not required.

Question 2.
Define a class to declare an integer array of size n and accept the elements into the array. Search for an element input by the user using linear search technique, display the element if it is found, otherwise display the message “NO SUCH ELEMENT. [10]
Answer:

import java.util.Scanner;
class Linear Search
{
public static void main(String args[])
int c, n, search, array[];
Scanner in = new Scanner(System.in);
System.out.println("Enter number of elements");
n = in.nextlnt(); array = new int[n];
System.out.println("Enter those " + n + " elements");
for (c = 0; c < n; C++)
array[c] = in.nextlnt();
System.out.println("Enter value to find");
search = in.nextlnt();
for (c = 0; c < n; C++)
{
if (array[c] = search) /* Searching element is present */
{
System.out.println(array[c]);
break;
}
}
if (c = n) /* Element to search isn’t present* /
System.out.println(search + "No such element”);
}
}

ICSE Class 10 Computer Applications Sample Question Paper 13 with Answers

Question 3.
Define a class to declare a character array of size ten, accept the character into the array and perform the following: [10]

  • Count the number of uppercase letters in the array and print.
  • Count the number of vowels in the array and print.

Answer:

public class CountUpperLower
{
public static void main(String[] args)
{
Scanner sc= new Scanner(System.in);
int uppercase = 0;
int vowels = 0;
char chh,ch;
System.out.println("Input some characters...");
char[10] a = sc.next().toCharArray();
for(int i=0;i<a.length;i++) { chh=a[i];
System.out.print(a[i]);
if(chh >='A' && chh <='Z') upperCase++;
ch=Character.toUpperCase(chh);
if (ch='A' I I ch='E' I I ch=T I I ch='0' I I ch='U') vOwels++;
}
System.out.println("Count of uppercase letters + uppercase);
System.out.println("Count of vowels:" + vowels);
}
}

ICSE Class 10 Computer Applications Sample Question Paper 13 with Answers

Question 4.
Define a class to declare an array of size 20 of double datatype, accept the elements into the array and perform the following: [10]

  • Calculate and print the sum of all the elements.
  • Calculate and print the highest value of the array.

Answer:

import java.util.Scanner;
public class MaxSum
{
public static void main(String args[])
{
Scanner in = new Scanner(System.in);
double arr[] = new double[20];
System.out.println("Enter 20 numbers:");
for (int i = 0; i < 20; i++)
{
arr[i] = in.nextDouble();
}
int max = arr[0], sum = 0;
for (int i = 0; i < arr.length; i++)
{
if (arr[i] > max)
max = arr[i];
sum += arr[i];
}
System.out.println("Largest Number = " + max);
System.out.println("Sum = " + sum);
}
}

ICSE Class 10 Computer Applications Sample Question Paper 13 with Answers

Question 5.
Define a class to accept two strings, convert them into uppercase, check and display whether two strings are equal or not, if the two strings are not equal, print the string with the highest length or print the message both the strings are of equal length. [10]
Answer:

import java.util.*;
public class Strings
{
public static void main(String [] args)
{
String sl="",s2="";
Scanner sc=new Scanner(System.in);
System.out.println("Enter two strings:");
sl=sc.nextLine();
s2=sc.nextLine();
sl=sl.toUpperCase();
s2=s2.toUpperCase();
if (!sl.equals(s2))
{
if (sl.length()>s2.1ength())
System.out.println(sl);
else
System.out.println(s2);
}
else
System.out.println("Strings are equal");
}
}

ICSE Class 10 Computer Applications Sample Question Paper 13 with Answers

Question 6.
Define a class to accept a string, convert it into lowercase and check whether the string is a palindrome or not.
A palindrome is a word which reads the same backward as forward. [10]
Example:
madam, racecar etc.
Answer:

public class Palindrome
{
public static void main(String args[])
{
String a, b = "";
Scanner s = new Scanner(System.in);
System.out.print("Enter the string you want to check:");
a = s.nextLine();
a=a.toLowerCase();
int n = a.lengthQ;
for(int i = n -1;
i >= 0; i--)
{
b = b + a.charAt(i);
}
if(a.equalsIgnoreCase(b))
{
System.out.println("The string is palindrome.");
}
else
{
System.out.println("The string is not palindrome.");
}
}
}

ICSE Class 10 Computer Applications Sample Question Paper 13 with Answers

Question 7.
Define a class to accept and store 10 strings into the array and print the strings with even number of characters. [10]
Answer:

import java.util.*;
public class Strings
{
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
String[] strArray = new String[10];
System.out.println("Enter 10 Strings:");
for (int i=0;i<3;i++)
strArray[i]=sc.nextLine();
for (int i=0;i<3;i++)
{
if (strArray[i].length() %2=0)
System.out.println(strArray[i]);
}
}
}

ICSE Class 10 Computer Applications Question Papers with Answers

Leave a Comment