ICSE Computer Applications Question Paper Solved Semester 2 for Class 10

Solving ICSE Class 10 Computer Applications Previous Year Question Papers ICSE Class 10 Computer Applications Question Paper 2022 Semester 2 is the best way to boost your preparation for the board exams.

ICSE Class 10 Computer Applications Question Paper 2022 Solved Semester 2

Maximum Marks: 50
Time Allowed: 1½

General Instructions:

  • Answers 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.
  • The marks intended for 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) Return data type of isLetter(char) is __________ .
(a) Boolean
(b) boolean
(c) bool
(d) char
Answer.
(b) boolean

ICSE 2022 Computer Applications Question Paper Solved Semester 2 for Class 10

(ii) Method that converts a character to uppercase is
(a) toUpper()
(b) ToUpperCase()
(c) toUppercase()
(d) toUpperCase(char)
Answer.
(d) toUpperCase(char)

(iii) Give the output of the following String methods:
“SUCESS”.indexOf(‘S) “+ “SUCESS”. latlndexOf(’S)
(a) 0
(b) 5
(c) 6
(d) – 5
Answer.
(b) 5

(iv) Corresponding wrapper class of float data type is
(a) FLOAT
(b) float
(c) Float
(d) Floating
Answer.
(c) Float

(v) ____________ class is used to convert a primitive data type to its corresponding object.
(a) String
(b) Wrapper
(c) System
(d) Math
Answer.
(b) Wrapper

(vi) Give the output of the following code: System.out.println(“Good”.concat(“Day”));
(a) GoodDay
(b) Good Day
(c) Goodday
(d) goodDay
Answer.
(a) GoodDay

ICSE 2022 Computer Applications Question Paper Solved Semester 2 for Class 10

(vii) A single dimensional array contains N elements. What will be the last subscript ?
(a) N
(b) N – 1
(c) N – 2
(d) N + 1
Answer.
(b) N – 1

(viii) The access modifier that gives least accessibility is:
(a) private
(b) public
(c) protected
(d) package
Answer.
(a) private

(ix) Give the output of the following code:
String A =”56.0″, B=”94.0″;
double C=Double.parseDouble(A);
double D=Double.parseDouble(B);
System.out.println((C+D));
(a) 100
(b) 150.0
(c) 100.0
(d) 150
Answer.
(b) 150.0

(x) What will be the output of the following code? System.out.println(“Lucknow”.substring (0,4));
(a) Lucknow
(b) Luckn
(c) Luck
(d) luck
Answer.
(d) luck

Section – B
(Attempt any four questions from this Section.)

Question 2.
Define a class to perform binary search on a list of integers given below, to search for an element input by the user, if it is found display the element along with is position, otherwise display the message “Search element not found. ” [10]
2, 5, 7, 10, 15, 20, 29, 30, 46, 50
Answer.

import java.util.Scanner; 
class Search {
int arr[ ] = {2, 5, 7, 10, 15, 20, 29, 30, 46, 50}; 
int n;
Search (int arr) { 
n = arr;
}
void search( ) {
int i = 0, len = arr.length, m; 
while(i <= len) { 
m = (i + len)/2; 
if(arr[m] == n) {
System.out.println("Found at = " +m); 
System.exit(0);
}
if(arr[m] < n) {
i = m+ 1;
}
if(arr[m] > n) {
len = m - 1;
}
System.out.printIn("Search element no found.");
}
}
}

ICSE 2022 Computer Applications Question Paper Solved Semester 2 for Class 10

Question 3.
Define a class to declare a character array of size ten, accept the characters into the array and display the characters with highest and lowest ASCII (American Standard Code for Information Interchange) value. [10]
EXAMPLE
INPUT
‘R’, ‘z’, ‘q’, ‘A’ ‘N’, ‘p’, ‘m’, V, ‘Q’, ‘F’
OUTPUT
Character with highest ASCII value = z
Character with lowest ASCII value = A
Answer:

import java.util.Scanner; 
class ASCII {
public static void main(String args[ ]) { 
Scanner sc = new Scanner(System.in); 
char arr[ ] = new char[10]; 
System.out.println("Enter characters");
double n = sc.nextDouble( ); 
for(int i = 0; i < 10; i++) { 
arr[i] = sc.next( ).charAt(0);
}
System.out.println("Entered numbers are"); 
for(int i = 0; i < 10; i++) {
System.out.println(arr[i] + "\t");
}
int i, len = arr.length, large = arr[0], small = arr[0];
for(i = 0; i < 10; i++) {
if (arr[i] > large) {
large = arr[i];
}
if(arr[i]< small) {
small = arr[i];
}
}
System.out.println("Character with Highest ASCII value =" +(char)large);
System.out.println("Character with Lowest ASCII value ="+(char)small);
}
}

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

  • Calculate and print the product of all the elements.
  • Print the square of each element of the array.

Answer:

import java.util.Scanner; 
class HighSmall {
public static void main(String args[ ]) {
Scanner sc = new Scanner(System.in); 
double air[ ] = new double[20]; 
System.out.println("Enter values"); 
double n = sc.nextDouble(); 
for(int i = 0; i < 20; i ++) { 
arr[i] = sc.nextDouble( );
}
System.out.println("Entered numbers are"); 
for(int i = 0; i < 20; i++) {
System.out.println(arr[i]+"\t");
}
int i, len = arr.length; 
double prod = 1; 
for(i = 0; i < len; i++) { 
prod = prod * arr[i];
System.out.println("Square of "+arr[i] + "=" +arr[i] * arr[i]);
}
System.out.println("Product of all the elements:" +prod);
}
}

ICSE 2022 Computer Applications Question Paper Solved Semester 2 for Class 10

Question 5.
Define a class to accept a string, and print the characters with the uppercase and lowercase reversed, but all the other characters should remain the same as before. [10]
EXAMPLE: INPUT : WelCoMe_2022
OUTPUT : wELcOmE_2022
Answer:

import java.util.Scanner; 
class UpperLower { 
public static void main(String args[ ]) { 
System.out.println("Enter a string:");
Scanner read = new Scanner(System.in);
String str = read.nextLine( );
String convert = "";
for(int i = 0; i < str.length(); i++) { 
char ch = str.charAt(i); 
if (Character.isUpperCase(ch)) { 
convert = convert + Character.toLower Case(ch);
}
else
if(Character.isLowerCase(ch)) { 
convert = convert + Character toUpper Case(ch);
}
else {
convert = convert + ch;
}
}
System.out.println("Original String is:" +str); 
System.out.println("Changed String is:" + convert);
} 
}

Question 6.
Define a class to declare an array to accept and store ten words. Display only those words which begin with the letter ‘A ’or ‘a ’and also end with the letter ‘A ’or ‘a ’. [10]
EXAMPLE:
Input: Hari, Anita, Akash, Amrita, Alina, Devi, Rishab, John, Farha, AM1THA
Output:
Anita
Amrita
Alina
AMITHA
Answer:

import java.util.Scanner; 
class Words {
public static void main(String args[ ]) {
String str[ ] = new String[10];
Scanner scan = new Scanner(System.in); 
System.out.println("Enter ten strings:"); 
for (int i = 0; i < 10; i++) { 
str[i] = scan.nextLine();
}
System.out.println( );
System.out.println("Entered strings are::"); 
for (int i = 0; i < 10; i++) {
System.out.println(str[i]);
}
System.out.printIn("Words are:"); 
for(int i = 0; i < 10; i++) {
if (str[i].startsWith("A") || str[i].startsWith ("a") && 
str[i].endsWith("a")|| str[i].ends With("A")) { 
System.out.println(str[i]);
}
}
System.out.println(" ");
}
}

ICSE 2022 Computer Applications Question Paper Solved Semester 2 for Class 10

Question 7.
Define a class to accept two strings of same length and form a new word in such a way that, the first character of the first word is followed by thefirst character ofthe second word and soon. [10]
Example: Input string 1-BALL
Input String 2-WORD
OUTPUT: BWAOLRLD
Answer:

import java.util.*; 
public class TwoStrings { 
public static void main(String atgs[ ]) {
Scanner sc= new Scanner(System.in); 
System.out.println("Enter First String: ");
String a = sc.nextLine();
System.out.println("Enter Second String: ");
String b = sc.nextLine( ); 
if(a.length( ) = b.length()){
System.out.printIn("Both strings are equal.");
} else { .
System.out.println("Both strings are not equal."); 
System.exit(0);
}
String newString = ""; 
for(int i = 0; i < a.length(); i++) { 
newString = newString + a.charAt(i) + b.charAt(i);
}
System.out.println(newString);
}
Refer More:

VOLTAS Pivot Point Calculator