ICSE Class 10 Sample Paper 2021-2022
- Categories Uncategorized
COMPUTER APPLICATIONS
(Theory)
(Two hours)
Answers to this Paper must be written on the paper provided separately.
You will not be allowed to write during the first 15 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.
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(2 marks each question)
Question 1.
a . What do mean by Inheritance and Polymorphism in Java?
b . Give the output of this code
int a = 9; a++;
System.out.println (a);
a -= a-- - --a;
System .out.println (a);
c . What is the value stored in x and y after execution of these statements?
double x = Math.ceil(8.3) + Math.floor(-3.2)+Math.rint(4.5);
double y = Math.abs(Math.round(Math.max( -4.4, -9.6)));
d . Give the total number of bytes occupied by these arrays?
- int ar[25]
- char M[3][4]
- double A[12]
e . What is the output of this code? Show the working
long num=729, sum 0;
for( long y= num; y> 0; y= y/10){
sum= sum + y % 10;
}
System.out.println("Sum of digits = "+ sum);
Question 2.
a . If int y = 10 then find int z = (++y * (y++ + 5));
b . State the result of the following statement.
System.out.print(“My Friends are \n”);
System.out.print(“Ronit \tNihir \t”);
System.out.print(“and Ananya too”);
c . What do you mean by function overloading? Explain with the help of one example.
d . What is the output of the following statements when executed?
char ch[ ]= {‘I’, ‘N’, T’, E’, ‘L’, P’, ‘E’, ‘N’, ‘T’, ‘I’, ‘U’, ‘M’};
String obj= new String(ch, 3, 4);
System.out.println(“The result is = “+ obj
e . Differentiate between Character.toLowerCase() and Character.toUpperCase() methods. With an example.
Question 3.
a . Explain the statements (i) and (ii) from the following code.
char x =’a’;
(i) x+= 3; // why will this run?
(ii) x= x +3; //why will this gives compile time error?
b . State the method that:
i. Converts a string to a primitive float data type
ii. Determines if the specified character is an uppercase character
c . What is the difference between pure and impure function?
d . What is this keyword? Also discuss the significance
e . State the output of this program Segment?
String str1 = ”great”;
String str2= “Minds”;
System.out.println(str1.substring(0,2). Concat(str2.substring(1)));
System.out.println(( “WH”+(str1.substring(2).toUpperCase() )));
f . Write a statement each to perform the following task on a string:
- Extract the second last character of a word stored in the variable wd.
- Cheek if the second character of a string str is in uppercase.
g . Find the errors in the given program segment and re-write the statements correctly to assign values to an integer array.
int a= new int(5);
for(int i=0; i<=5; i++)
a[i]= I;
h . What do you mean by Punctuators? Give examples.
i . If String n1 = “99”; and String n2=”100”; Give the output of the following:
- String st= n1+n2; System.out.println (st) ;
- System.out.println( n1.charAt( 1 ));
- System.out.println( n2 + n1);
- System.out.printlnt (n1+ “ ”+n2); [2]
j . Write an expression for :
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/Mnemonic Codes such that the logic of the program is clearly depicted.
Flow-Charts and Algorithms are not required .
Question 4.
Define a class employee having the following description:Data members: int Epan : To store personal account number Instance variables String Ename : To store name. double taxincome : To store annual taxable income. double tax : To store tax that is calculated. Member functions: inputData () : Store the pan number, name, taxable income. cal() : Calculate tax of an employee. display() :Output details of an employee.
Write a program to compute the tax according to the given conditions and display the output as per given format.Total Annual Taxable Income Tax Rate Up to 1, 00, 000 No tax From 1, 00, 001 to 1, 50, 000 10% of the income exceeding 1, 00, 000 From 1, 50, 001 to 2, 50, 000 5000+20% of the income exceeding 1, 50, 000 Above 2, 50, 000 25000+30% of the income exceeding 2, 50, 000
Output:
Pan Number Name Tax-Income Tax
………………. …………… ……………… …………..
………………. …………… ……………… …………..
Question 5.
Write a program in Java to store 10 numbers each in two different Single Dimensional Array. Now, merge the numbers of both the arrays in a Single Dimensional Array. Display the elements of merged array
Sample Input:Array a: a[0] a[1] a[2] a[3] a[4] 10 21 44 45 32 Array b: b[0] b[1] b[2] b[3] b[4] 35 56 27 91 64
Sample Output:
The list after merging of two arrays:c[0] c[1] c[2] c[3] c[4] c[5] c[6] c[7] c[8] c[9] 10 21 44 45 32 35 56 27 91 64
Question 6.
Write a class to design the given function to perform the related tasks:
double volume1( double side )- to find and return volume of cube using (side*side*side).
double volume2( double l, double b, double h)- to find and return volume of cuboid using:(length*breadth*height).
double volume3( double r )- to find and return volume of cylinder using: ((4/3)πr^3)
Question 7.
Using the switch statement, write a menu driven program for the following:
1 . To print the Floyd’s triangle [Given below]
1
2 3
4 5 6
7 8 9 10
11 12 13 14 15
2 . To display the following pattern
I
I C
I C S
I C S E
Question 8.
Write a menu driven program to display
(i) print if given number is buzz number or not
(ii) print if given number is Armstrong number or not.
Enter ‘1’ to check if given number is buzz numbers or not and enter ‘2’ to check if given number is Armstrong number or not.
Question 9.
Write a program to initialize the following character arrays and print a suitable message after checking the arrays whether the two arrays are identical or not. Make suitable use of boolean data type.
X[]={‘m’, ‘n’. ‘o’. ‘p’) and Y[]={‘m’, ‘a’, ‘o’, ‘p’}