ICSE Class 10 Computer Applications Sample Question Paper 6 with Answers

ICSE Class 10 Computer Applications Sample Question Paper 6 with Answers

Section – A (40- Marks)
Attempt all questions

Question 1
(a) Define encapsulation.
(b) What are keywords? Give an example.
(c) Name any three library packages.
(d) Name the three types of error, syntax, runtime or logical error in the following case below:
(i) Math.sqrt (36 – 45)
(ii) inta;b;c
(c) If int x [ ] = {4,3,7,8,9,10}; what are the values of p and q?
(i) p = x.length
(ii) q = x[2] + x[5]*x[1]
Answer:
(a) Encapsulation is wrapping up of data and its associated functions into a single unit. It is achieved by the use of access specifiers like 1 public, private, and protected.

(b) Keywords are tokens in java that have a specific meaning.
E.g. static

ICSE Class 10 Computer Applications Sample Question Paper 6 with Answers

(c) java.lang
java.io
java.util

(d) (i) logical
(ii) Syntax

(e) (i) 6
(ii) 37

Question 2
(a) State the difference between = = operator and equals ( ) method.
(b) What are the type of casting shown by the following examples:
(i) char c (char) 120;
(ii) int x = ‘t’;
(c) Differentiate between formal parameter and actual parameter.
(d) Write a function prototype of the following:
A function PosChar which takes a string argument and a character argument and returns an integer value.
(e) Name any two types of access specifiers.
Answer:
(a)

== operator equals( )
It compares two primitive data types It compares two strings

(b) (i) Explicit
(ii) Implicit
(c) Formal parameters are used in the function definition using arguments as the input to the function. Actual parameters are used in calling the above function by passing values.
(d) int PosChar(String str, char ch);
(e) private and protected.

ICSE Class 10 Computer Applications Sample Question Paper 6 with Answers

Question 3
(a) Define an impure function.
Answer:
(a) An impure function is a function where the values passed in the formal arguments of function is reflected back in the main function when values are changed by the called function.

(b) Explain the function overloading with example.
Answer:

void lol( )
{
String str = "lol";
}
void lol(int a)
{
String str1 = "lol";
}

(c) What is default constructor and where is it useful?
Answer:
Default constructor is a constructor without any parameter. It is used to initialize class variables to their default values.

ICSE Class 10 Computer Applications Sample Question Paper 6 with Answers

(d) State the difference between selection sort and bubble sort.
Answer:

Selection Sort Bubble Sort
One element is compared with all the elements of the array and position is exchanged at the end of comparison. Adjacent elements of the array are compared and exchanged.

(e) Int i = 5;
if (++5/2 = =0)
System.out.printC’EVEN”);
else
System.out.printC’ODD”);
Answer:
error

ICSE Class 10 Computer Applications Sample Question Paper 6 with Answers

(f) Convert the following while loop to the corresponding fir loop:
int m = 5, n =10; while (n>=1)
{
System.out.println(m*n); n – -;
}
Answer:
50
45
35
30
25
20
15
10
5

(g) Write one difference between primitive data types and composite date types.
Answer:
Primitive data type: Its fundamental data types of java.
Composite data type: It’s a combination of primitive data type.

ICSE Class 10 Computer Applications Sample Question Paper 6 with Answers

(h) Analyze the given program segment and answer the following question:
Answer:
(i) 5
10
(ii) 3

(i) Write the output of the program segment
Answer:
39

(ii) How many times does the body of the loop get executed?
for (int m = 5; m<=20; m+=5)
{
if(m%3==0)
break;
else
if (m%5==0)
System.out.println(m);
continue;
}
a. Give the output of the following expression:
a+=a++ + ++a +– a + a–; when a=7
b. Write the return type of the following library
(i) isLetterOrDigit(Char)
(ii) replace(char, char)
Answer:
(i) boolean
(ii) String

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.

ICSE Class 10 Computer Applications Sample Question Paper 6 with Answers

Question 4
Define a class named BookFair with the following description:
Instance variables/Data members
String Bname – stores the name of the book
double price – stores the price of the book member method.
(i) Book Fair( ) – Default constructor to initialize data members
(ii) void Input ( ) – To input and store the name and the price of the book.
(iii) Avoid Calculation ( ) – To calculate the price after discount. Discount is calculated based of the following criteria
ICSE Class 10 Computer Applications Sample Question Paper 6 with Answers 1
Write a main method to create an object of the class and call the above member methods.
Answer:

import java.util.*; 
class BookFair 
{
String Bname; double price;
BookFair ( )
{
Bname = price = 0.0;
}
void input ( )
{
Scanner sc = new Scanner(System.in); 
System.out.println("Enter name and price of the book:"); 
Bname = sc.nextLine( ); 
price = sc.nextDouble( );
}
void display!)
{
System.out.println(" Name: "+Bname+"\n"+"Price:"+price);
}
void calculate!)
{
double discount =0;
if(price <= 1000)
discount = (2.0/100.0)*price;
else if(price >1000 && price <= 3000)
discount = (10.0/100.0)*price;
else if(price >3000)
discount = (15.0/100.0)*price;
else;
price = price - discount;
}
public static void main!)
{
BookFair bf = new BookFair!);
bf.input( );
bf.calculate( );
bf.display( );
}
}

ICSE Class 10 Computer Applications Sample Question Paper 6 with Answers

Question 5
Using the switch statement, write a menu driven program
(i) To print the Floyd’s triangle [Given below]
ICSE Class 10 Computer Applications Sample Question Paper 6 with Answers 2

(ii) To display the following pattern
ICSE Class 10 Computer Applications Sample Question Paper 6 with Answers 3
For an incorrect option, an appropriate error message should be displayed
Answer:

import java.util.*; 
import java.math.*;
 class lol 
{
public static void main(String[ ] args)
{
Scanner sc = new Scanner(System.in);
System.out.println(''Enter 1 for number pattern and 2 for string pattern");
int opt = sc.nextlnt( ); 
switch(opt)
{
case 1: int a = 1;
forfint i =1;i<=5;i++)
{
for(int j = 1;j<=i;j++)
{
System.out.print(a+"");
a++;
}
System.out.println( );
}
break;
case 2 : String str = "ICSE";
for(int i =0;i <str.length( );i++)
{
forfint j =0;j<=i; j++)
{
char ch = str.charAt(j);
System.out.print(ch+" ");
}
System.out.println( );
} 
break;
default: System.out.println("ERROR");
}// end of switch 
}//end of main 
}//end of class

ICSE Class 10 Computer Applications Sample Question Paper 6 with Answers

Question 6
Special words are those words which starts and ends with the same letter
Example:
EXISTENCE
COMIC
WINDOW
Palindrome words are those words which read the same from left to right and vice versa
Example:
MALYALAM
MADAM
LEVEL
ROTATOR
CIVIC
All palindromes are special words but all words are not palindromes.
Write a program to accept a word check and print whether the word is a palindrome or only a special word
Answer:

import java.util.*;
class Main {
public static void main(String [ Jargs)
{
Scanner sc = new Scanner(System.in); 
System.out.println("Enter a word:");
String str = sc.next( );
String word ="";
for (int i = str.length()-1;i >=0;i--)
{
char ch = str.charAt(i); word = word+ch;
}
if(word.equals(str))
System.out.println("Palindrome");
else
{
if(str.charAt(0)==str.charAt(str.length( )-1))
System.out.println("special word");
}
}
}

ICSE Class 10 Computer Applications Sample Question Paper 6 with Answers

Question 7
Design a class to overload a function SumSeriesQ as follows:
(i) void SumSeries(int n, double x) – with one integer argument and one double argument to find and display the sum of the series given below:
\(s+\frac{x}{1}-\frac{x}{2}+\frac{x}{3}-\frac{x}{4}+\frac{x}{5} \ldots \ldots \ldots \text { to n terms }\)

(ii) void SumSeries( ) – To find and display the sum of the following series:
s = 1+(1*2)+(1*2*3)+ ………… +(1*2*3*4* ………… n)
Answer:

import java.util .*; 
class lol 
{
void sumseries(int n, double x)
{
double sum =0; for(int i =1;i<=n;i++)
{
if(i % 2 == 0)
{
sum = sum -(x/i);
}
else
{
sum = sum + (x/i);
}
}
System.out.printlnC'sum = "+sum);
}
void sumseriesO
{
long sum = 0; long product = 1; for(int i = 1;i <=20;i++)
{
product = product * i; sum+= product;
}
System.out.printlnC'sum = "+sum);
}
}

ICSE Class 10 Computer Applications Sample Question Paper 6 with Answers

Question 8
Write a program to accept a number and check and display whether it is a Niven number or not. (Niven number is that number which is divisible by its sum of digits).
Example:
Consider the number 126.
Sum of its digits is 1+2+6 = 9 and 126 is divisible by 9.
Answer:

import java.util.*; 
class lol 
{
public static void main(String [ jargs)
{
Scanner sc = new Scanner("System.in");
System.out.println("Enter a num:");
int a = sc.nextlnt( );
int al = a;
int sum =0;
while(a1!=0)
{
int k = a 1 % 10; 
sum = sum+ k;
a 1 /= 10;
}
if(a%sum ==0)
System.out.println("Niven number"); else
System.out.println("Not Niven number"); 
}//end of main 
}// end of class

ICSE Class 10 Computer Applications Sample Question Paper 6 with Answers

Question 9
Write a program to initialize the seven Wonders of the World along with their locations in two different arrays. Search for a name of the country input by the user. If found, display the name of the country along with its Wonder, otherwise display “Sorry Not Found!”
Seven wonders – CHICHEN ITZA, CHRIST THE REDEEMER, TAJMAHAL, GREAT WALL
OF CHINA, MACHU PICCHU, PETRA, COLOSSEUM
Locations – MEXICO, BRAZIL, INDIA, CHINA, PERU, JORDAN,
ITALY
Example – Country Name: INDIA Output: INDIA -TAJMAHAL
Country Name: USA Output: Sorry Not Found!
Answer:

import java.util.*; 
class lol {
public static void main(String args[ ])
{
String wonder[ ]={"CHICHEN ITZA","CHRISTTHE REDEEMER", "TAJMAHAL", "GREATWALL OF CHINA","MACHU PICCHU","PETRA","COLOSSEUM"}; 
String country} ]={"MEXICO","BRAZIL1,"INDIA","CHINA","PERU","JORDAN","ITALY"}; 
String str; int i,len;
Scanner sc=new Scanner(System.in);
System.out.printlnC'Enter the name");
str=sc.nextLine();
len=str.length();
boolean flag=false;
for (i=0;i<len;i++)
{
if(str.equalslgnoreCase(country[i]))
{
System.out.println(country[i]+""+ wonderfi]);
flag =true;
break;
}
}
if(flag== false)
System.out.println("Sorry Not Found"); 
}//end of main 
}//end of class

ICSE Class 10 Computer Applications Sample Question Paper 6 with Answers

Variable Data Type Description
discount Double store discount value
opt int Option number
ij int For looping
a int For printing pattern
ch char Reading each character of word.
str String To read word
word String To store reverse word
sum double Store the series of sum
product long Stores product of integers.
a int Read users number
a1 int Modifying the digits
flag boolean To check true or false

ICSE Class 10 Computer Applications Question Papers with Answers

ICSE Class 10 Computer Applications Sample Question Paper 5 with Answers

ICSE Class 10 Computer Applications Sample Question Paper 5 with Answers

Section – A
Attempt all questions

Question 1
(a) What is the use of ‘this’ keyword in parameterized constructor?
(b) State the differences between static and dynamic initialization.
(c) What is local variable and global variable? Explain with example.
(d) Which is not keyword in Java:
(i) boolean
(ii) void
(iii) public
(e) int a [ ]; int b [ ] = new int [100]; what is the difference between two initialization.
Answer:
(a) This keyword in parameterized constructor is used to refer to the currently calling object.

ICSE Class 10 Computer Applications Sample Question Paper 5 with Answers

(b) Static initialization is used when memory is already allocated and then value is assigned.
Dynamic initialization is used to calculate the value at the run time and then allocate the memory.
E.g. int a = 6,b=9;//static memory allocated.
int c = a*b; //dynamic memory allocation.

(c) Local variable is a variable whose scope remains inside a method or a block of statements in a java program. The Global variable is a variable whose scope lies throughout the class in the java program.

(d) boolean

(e) int a[ ]: the array is declared without any allocation of memory space to it.
int b[ ] = new int [100]; The array is declared along with the allocation of memory to it. ie. 400 bytes.

ICSE Class 10 Computer Applications Sample Question Paper 5 with Answers

Question 2
(a) State difference between constructor and method of class.
(b) char ch[ ] = {‘a’, ‘b’, ‘c’, ‘d’};
System.out.println( “hello world”+ch);
What will be the output of the above code?
(c) Define Java byte code.
(d) State the difference between operator and expression.
(e) What parse function does? Explain with example.
Answer:
(a)

Constructor Method
It has same name as that of class. It has different name than that of class.
It has no return type. It is called when object is created. It has a return type and is called by the object.

(b) Hello world abed
(c) The set of instructions to be executed by the JVM is called java byte code. JVM is the interpreter for java byte code.
(d)

Operator Expression
It is used to perform an operation. Set of operators used to perform multiple function.
int a =1, b =2;
int c = a+b;
inta =1;
a+ = (a++) – ++ a +– a;

(e) Parse function converts the value of a primitive data to the value of another primitive data type.
E.g.: String a = “24”;
int a = Integer.parselnt(a);

ICSE Class 10 Computer Applications Sample Question Paper 5 with Answers

Question 3
(a) What is the use of keyword in void in function declaration.
(b) Which OOP principle is used in function overloading?
(c) Attempt the following:
(i) Name string function which compares two strings and returns boolean value
(ii) Write Java statement to do the reverse loop from 19 to 0.
(iii) Define Java token.
(iv) What’s the value of y after execution.
Inty = 5;
y – – = ++y + ++y + ++y *3;
(v) int a [ ] = {‘a1, ‘b\ Tc’, ‘A1, ‘B’, ‘C, ‘D’, ‘E’};
System.out.println ((int) a[3]);
System.out.println (a.length);
System.out.println (a[4]);
What will the output of the above code?
(d) Write output
inti = 20
for(; I<=30; i+=4)
System.out.print(i);
System.out.println(i)
(e) Name the formal and actual parameter.
(f) What is the difference between next ( ) and nextLine ( )?
Answer:
(a) The keyword void is used to tell that function has no return type.
(b) Polymorphism
(c) (i) equals( )
(ii) int i = 19;
do {
System.out.println(i);
i – -;
}
while(i>0);

ICSE Class 10 Computer Applications Sample Question Paper 5 with Answers

(iii) Java token is the smallest unit of a java program.
(iv) 5 + 6 + 7*3 = 5+6+24 = 32.
(v) 65
8
66
(vi) 20 24 28 32
(vii) Formal parameter: When the identifier used in function definition to accept the values from the calling function is called the formal parameter.
Actual parameter: when the function is called by passing the identifiers which has values are called as actual parameter.
(viii) next( ): it accepts only the word without blank spaces.
nextLine( ) : It can accept more than one word as well.

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 salary described as below:
Data Members: Name, Address, Phone, Subject Specialization, Monthly Salary, Income Tax
Member methods:
(i) To accept the details of a teacher including the monthly salary.
(ii) To display the details of the teacher.
(iii) To compute the annual income tax as 5% of the annual salary above rs. 1,75,000/.Write the main method to create object of the class and call the above member method.
Answer:

import java.util.*; 
class salary 
{
String name, address;
String sub; 
double ms, it; 
long ph; 
salary ( )
{
name = " "
address = " "
sub=" "; 
ms = 0.0; 
it = 0.0;
ph=0;
}
void input ( ) 
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter name address subject monthly salary and phone number:");
name = sc.nextLine( );
address = sc.nextLine( );
sub = sc.nextLine ( );
ms = sc.nextDouble( );
ph = sc.nextLong( );
}
void display( ) 
{
System.out.println(" Name: "+name+'\n"+sub+''\n"+"monthly salary:"+ms+ "\n"+"Phone no:"+ph);
}
void calc( )
{
if(ms*12<=175000)
it = 0;
else
it = 5.0/100.0 * (ms*12); 
ms = ms*12 - it;
}
public static void main( )
{
salary oly = new salary( ); 
oly.input( ); 
oly.display( ); 
oly.calc( );
}
}

ICSE Class 10 Computer Applications Sample Question Paper 5 with Answers

Question 5
Write a program to initialize the given data in an array and find the minimum and maximum values along with the sum of the given elements.
Numbers: 2 5 4 1 3
Output: Minimum value:1
Maximum value: 5
Sum of the elements:
Answer:

import java.util.*; 
public class Main 
{
public static void main(String[ ] args)
{
int arr[ ] = new int[10];
Scanner sc = new Scanner(System.in); 
for(int i =0;i<10;i++)
{
System.out.printlnC'enter a number: "); 
arr[i] = sc.nextlnt( );
}
int min = 100000;
int max = 0; 
int sum = 0; 
for(int i =0;i<10;i++)
{
if (arr[i] < min) min = arr[i]; 
if(arr[i]>max) 
max = arr[i]; 
sum+= arr[i];
}
System.out.println('Minimum value: "+min); 
System.out.println("Maxmimu value: "+max); 
System.out.println("Sum of elements: "+sum); 
}//end of main 
}//end of class

ICSE Class 10 Computer Applications Sample Question Paper 5 with Answers

Question 6
Define a class to overload following function
double area (double a, double b, double c) A = √s (s-a) (s-b) (s-c)
S = (a+b+c)/2
double area (double x, double y, double h) area = 1/2 h* (x+y)
double area (double m, double n) area = 1/2 m*n
Answer:

import java.util .*; 
import java.math *; 
class lol 
{
double area(double a, double b, double c)
{
double s = (a + b + c)/2.0;
double ar = Math.sqrt(s*(s-a)*(s-b)*(s-c));
return ar;
}
double area(double x,double y,double h,int a)
{
double ar1 = 1.0/2.0 *h*(x+y); 
return ar1;
}
double area(double m, double n)
{
double ar2 = 1.0/2.0*m*n; return ar2;
}
}

Question 7
Write a program to enter a sentence from the keyboard and count the number of times a particular word occurs in it. Display the frequency of the search word.
Example:
INPUT:
Enter a sentence: the quick brown fox jumps over the lazy dog.
Enter a word to be searched: the
OUTPUT:
Searched word occurs: 2 times.
Answer:

import java.util.*; 
class lol {
public static void process(String a, String str)
{
String word =""; 
int count =0 ;
for(int i =0; i <str.length( );i++)
{
char ch = str.charAt(i);
if(ch!='') word = word+ch; 
else 
{
if(a.equals(word))
count++;
}
}
// end of for loop 
System.out.println(count);
}
}

ICSE Class 10 Computer Applications Sample Question Paper 5 with Answers

Question 8
Write a program to create two array names A and B of same size 7. Perform the following operation:
(i) Input in an array A and find square of each number and store in array B and display both array simultaneously.
(ii) Display square root of each number from array A and display square root.
Answer:

import java.util.*;
import java.math.*;
class lot {
public static void main( )
{
Scanner sc = new Scanner(System.in); 
int a[ ] = new int [7]; 
int b[ ] = new int[7]; 
System.out.println("enter a number: ");
for(int i =0;i <a.length; i++)
{
a[i] = sc.nextlntO; b[i] = a[i]*a[i];
}
for(int i =0;i <a.length; i++)
{
System.out.println(a[i]+""+b[i]);
}
for(int i =0; i<a.length; i++)
{
double k= Math.sqrt(a[i]);
System.out.println(k);
}
}//end of main 
}//end of class

ICSE Class 10 Computer Applications Sample Question Paper 5 with Answers

Question 9
Write a program to input a number from user and using binary search method find the number is present in the given array or not. Display proper message.
Array is A [ ] = (24,39,330,343, 763, 789, 909,1001,1212, 2000}
Answer:

import java.util.*; 
import java.math.*; 
class lol 
{
public static void main( )
{
int arr[ ] = {24,39,330,343,763,789,909,1001,1212,2000}; 
int first = 0;
Scanner sc = new Scanner(System.in);
System.out.printlnC'enter a number:");
int key = sc.nextlnt( );
int last = arr.length-1;
int mid = (first + last)/2;
while(first <= last)
{
if (arr[mid] < key)
{
first = mid + 1;
}
else if (arr[mid] == key)
{
System.out.println("Element is found at index:" + mid); 
break;
}
else
{
last = mid - 1;
}
mid = (first + last)/2;
}
if (first > last)
{
System.out.println("Element is not found!");
}
}//end of main
} //end of class

ICSE Class 10 Computer Applications Sample Question Paper 5 with Answers

Variable Data Type Description
ms double Store monthly salary
it double Income tax
arr[] int Store 10 integers
min,max,sum int Minimum value maximum value and sum of all elements.
s a b c double Semiperimeter lengths of triangle.
ar,ar1,ar2 double Area of shapes
word String Store new word
count int Store number of similar words.
a[ ]b[ ] int Array of integers and squares
k double Square root of number
arr[ ] int Static array
key int Number to be searched.
first last and mid int Indexes of array

ICSE Class 10 Computer Applications Question Papers with Answers

ICSE Class 10 Computer Applications Sample Question Paper 4 with Answers

ICSE Class 10 Computer Applications Sample Question Paper 4 with Answers

Section – A (40- Marks)
Attempt all questions

Question 1
(a) What is encapsulation? How does Java achieve encapsulation?
Answer:
(a) Encapsulation is the wrapping of the data and its associated functions into a single unit. Java achieve encapsulation by enclosing the data and methods in the class.

(b) True or False:
(i) The default case is compulsory in the switch case statement
(ii) The default initial value of a boolean variable data type is false.
Answer:
(i) False
(ii) false

(c) Define the term byte code.
Answer:
High level program is compiled by java compiler to put in language called bytecode. This is understood by JVM in executing it.

ICSE Class 10 Computer Applications Sample Question Paper 4 with Answers

(d) What is the result code stored in x, after evaluating the following expression:
int x = 5;
x+ =++*2+3*- -x;
Answer:
30

(e) What is function prototype? Write a function prototype of:
A function poschar which takes a string argument and a character argument and returns an integer value.
Answer:
Function prototype is the declaration of function with its return type and number of arguments and data type of arguments.
int PosChar(String str, char ch);

Question 2
(a) Show how the sequence {10,5,8,12,45,1,9,11,2,23} changes step by step during the first two passes while arranging in ascending order using the bubble sort technique.
Answer:
10,5,8,12,45,1,9,11,2,23
5.10.8.12.45.1.9.11.2.23
5.8.10.12.45.1.9.11.2.23

(b) How will you import a scanner package? What is the default delimiter of an instance of the scanner class?
Answer:
import java.util.*; Default delimiter for scanner class is white space or tab or newline.

ICSE Class 10 Computer Applications Sample Question Paper 4 with Answers

(c) Differentiate between Character. isl)pperCase( ) and Character, to UpperCase( )
Answer:
lsUpperCaseO checks the uppercase character and returns boolean value.
Character.toUpperCase( ) converts lower case character to upper case character and returns upper case character.

(d) Write a Java expression:! = 2π√L/g
Answer:
doubeT = 2*3.14 * Math.sqrt(l/g);

(e) What is fall through? Give example.
Answer:
Fall through is a way in which all the cases of switch statement will be executed one by one if break is not encountered.
E.g. After case B is executed it executes case C to F.

switch(grade)
{
case 'A':
System.out.printlnC'Excellent!");
break;
case 'B':
case 'C':
System.out.printlnC'Well done"); case 'D' :
System.out.println("You passed"); case 'F':
System.out.println("Better try again");
break;
default:
System.out.println("lnvalid grade");
}

ICSE Class 10 Computer Applications Sample Question Paper 4 with Answers

Question 3
Write the output of the following print statement:
(a) out.print (“IXIXI”,replace(‘X ‘C’).indexOf(‘C’).indexOf(‘C’,2));
(b) out.print(“robotics”.substring(1,3).concat(“subject”.substring(3)));
(c) out.printC’FUN WORLD”.startsWith(“FUN”)==
(“COMPUTER IS FUN”.endsWith(“FUN”)));
(d) out.print(Math.sqrt(Math.abs(Math.ceil(-25.25))));
(e) out.print(Math.max(Math.pow(Math.round(6.25),2),(Math. pow(Math.rint(1.8),3))));
Answer:
(a) 3
(b) object
(c) true
(d) 0
(e) 36

Question 4
Write the output of the following segment of code:

a. String x = “abyz”
Int i;
for(i=0; i<4; i++)
System.out.println(x.charAt(i) – 32);
b. Int a = 0, b = 10, c = 20, d = 0;
a=(b>1)? c >1 ||d>1? 100:200:300
System.out.print(a);
c. int m[ ] = {1,4,9,16,25);
int a[ ] = {11};
for(int i = 0;i<5;i++)
System.out.println(a[0] + m[i]);
d. forfint j = 16;j< = 25; j+ = 2
System.out.println(j + “” + j-1);
e. int m = 1,n=0.
for(; m+n<19++n)
{
System.out.printlnC’Hello”);
m=m+10;
}

Answer:
(a) 65
66
89
90

(b) 100

(c) 12
15
20
27
36

ICSE Class 10 Computer Applications Sample Question Paper 4 with Answers

(d) 1615
1817
2019
2221
2423

(e) Hello
Hello

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 5
Given below is hypothetical table showing rates of Income Tax for male citizens below the age of 65 years:

Taxable Income (Tl) in Rs. Income Tax in Rs.
Does not exceed 1,60,000 NIL
Is greater than 1,60,000 and less than or equal to 5,00,000 10% of the amount exceeding 1,60,000
Is greater than 5,00,000 and less than or equal to 8,00,000 20% of the amount exceeding 5,00,000 + 34000
Is greater than 8,00,000 30% of the amount exceeding 8,00,000 + 94000

Write a program to input the age, gender(male or female) and Taxable Income of the person. If the age is more than 65 years or the gender is female, display “wrong category”. If the age is less than or equal to 65 years and the gender is male, compute and display the Income Tax payable as per the table given above. Also if Income Tax calculated in over Rs.10,000/- then extra surcharge payable is 2% of the income tax.
Answer:

import java.util.*;
class Incometax 
{
public static void main( )
{
Scanner sc = new Scanner(System.in); 
System.out.print("Enter your gender m or f:"); 
char ch = sc.next( ).
charAt(0); 
if(ch==,f,||ch=='F')
{
System.out.println("Wrong Category");
}
else if(ch=='mj|ch=-M')
{
System.out.print("Enter your age:");
int age = sc.nextlnt( ); if(age>65)
{
System.out.println("Wrong Category");
}
else
{
System.out.print("Enteryour income:"); 
double inc = sc.nextDouble( ); 
double tax; if(inc<=l 60000)
{
tax=0;
}
else if((inc> 160000)&&(inc<=500000))
{
tax = (inc—160000)*0.1;
{
else if((inc>500000)&&(inc<=800000))
{
tax = (inc-500000)*0.2; 
tax += 34000;
}
else
{
tax = (inc-800000)*0.3; 
tax += 94000;
}
if(tax > 10000) tax+= tax* 0.02;
System.out.println("\nlncomeTax is INR "+tax);
} 
else
{
System.out.println("Invalid Gender");
}
}//end of main 
}//end of class

ICSE Class 10 Computer Applications Sample Question Paper 4 with Answers

Question 6
Define a class Customer described as below:
Data members/instance variables:
String card_holder: Name of the card holder, long cardholder: card Number
char card_type: type of card (Silver (S) / Gold (G) / Platinum (P)) double amt: purchase made using the card.

Member methods:
(i) Customer( ): Default constructor to initialize all the date members
(ii) void input( ): To accept the details of the cardholder
(iii) void compute( ): To compute the cashback after availing the discount of a specific card type as per the following:

Card Type Cash Back
Silver (S) 2% of purchase amount
Gold (G) 5% of purchase amount
Platinum (P) 8% of purchase amount

ICSE Class 10 Computer Applications Sample Question Paper 4 with Answers

(iv) void display!): To display the details in the format:

Card Card Card Purchase Cash
Holder Number Type Amount Back
XXX XXX XXX XXX XXX

Write a main method to create an object of the class and call the above member methods.
Answer:

import java.util.Scanner; 
class Customer 
{
String card_holder; 
long card_no;
charcard_type; 
double amt- double cash_back; 
public Customer( )
{
card_holder="";
card_no =0; 
card_type =' 
amt = 0.0;
}
public void input( )
{
Scanner scanner = new Scanner(System.in);
System.out.print("Enter customer name:"); 
card_holder = scanner.next( );
System.out.printfEnter card number:"); 
card_no = scanner.nextlnt( );
System.out.print("Entertype of the card [S/G/P: "); 
card_type = scanner.next( ).charAt(O);
System.out.print("Enter amount of purchase made using the card:"); 
amt = scanner.nextDouble( );
}
public void compute( )
{
if (card_type == ’S')
{
cash _back = amt * 0.02;
}
else if (card_type == 'G')
{
cash_back = amt * 0.05;
}
else if (card_type == 'P')
{
cash_back = amt * 0.08;
}
else
{
System.out.printf'lnvalid card type ");
}
}
public void display!)
{
System.out.println("Card Holder. \tCard Number. \t Card type \t 
Purchase Amount \t Cash back");
System.out.println(card_holder + "\t" + card_no + "\t" + card_type + "\t" + amt);
}
public void main( )
{
Customer cl = new Customer( );
cl.input( );
cl.compute( );
cl.display( );
}
}

ICSE Class 10 Computer Applications Sample Question Paper 4 with Answers

Question 7
Accept a sentence and print a new sentence with all the odd placed words in uppercase and even placed words in lower case.
Sample input: It is a beautiful world
Sample output: IT is A beautiful WORLD
Answer:

import java.util.*; 
class lol {
public static void main( )
{
Scanner sc = new Scanner(System.in); 
System.out.println("Enter a string:");
String str = sc.nextLine( );
String strl = str.toLowerCase( ); str1+=" ";
String word =" "; int count = 0;
for(int i =0; i < strl ,length( );i++)
{
char ch = strl .charAt(i); if(ch!='')
{
word+=ch;
}
else
{
count++; if (count %2 !=0)
{
System.out.print(word.toUpperCase( )+"");
}
else
System.out.print(word+""); word ="";
}
}
}
}

Question 8
Using switch statement, write a menu driven program to
(i) Accept a number and find a sum of all the even numbers in the number.
Sample input: 24567
Sample output: Sum = 12 (2+4+6)

(ii) Accept a number and print those digits which are divisible by 3
Sample input: 135689
Sample output: Numbers divisible by 3 are 3,6, 9
Answer:

import java.util.*; 
class lol {
public static void main( )
{
Scanner sc = new Scanner(System.in); 
double sum = 0; int b =0;
System.out.println("Enter 1 for even number addition and 2 for printing numbers divisible by 3"); 
int ch = sc.nextlnt( ); switch(ch)
{
case '1int a = sc.nextlnt( ); b=a;
while(b % 10 !=0)
{
int temp = b %10; if (temp %2 = = 0)
 sum+=temp; b = b/10;
}
System.out.println(sum);
break;
case '2': 
int k = sc.nextlnt( ); b =k;
while(b %10 !=0)
{
int temp = b %10; if (temp %3 == 0)
System.out.println(temp); b = b/10;
}
break;
default: System.out.println("Error"); break;
}
}//end of main 
}//end of class

ICSE Class 10 Computer Applications Sample Question Paper 4 with Answers

Question 9
Write a program to accept 50 student names and their school in two separate single dimension arrays. Search for the school name input by the user in the list. If found, display “Search Successful” and print the name of the school along with the student name, or else display the message “Search Unsuccessful.”
Answer:

import java.util.*; 
class lol {
public static void main( ) {
String[ ] student_name = new String[50];
Stringt ] schooLname = new String[50];
Scanner sc = new Scanner(System.in); 
forfint i = 0; i < 50; i++)
{
System.out.printlnC'Enter students name :"); 
student_name[i] = sc.nextLine( );
System.out.printlnC'Enter schools name;"); 
school_name[i] = sc.nextLine( );
}
System.out.println("Enter schools name you want to search:"); 
String str = sc.nextLineO; int flag =0;
for(int i =0; i < 50;i++)
{
if(school_name[i].compareTo(str)==0)
{
System.out.println( "Search successful ");
System,out.println(school_name[i]+""+student_name[i]);
flag = 1 ;
break;
}
}
if (flag == 0)
System.out.println("Search Unsuccessful");
}
}

Question 10
Design a class to overload a function pattern() as follows:
(i) void pattern(int n): with one int argument that prints the pattern as follows:
Input value of n = 5
ICSE Class 10 Computer Applications Sample Question Paper 4 with Answers 1

(ii) void pattern (int n, char ch): with one int argument and one. character argument to print the pattern as follows:
Input value of n = 5
Input value of ch =’*’
Output:
1*
1* 2*
1* 2* 3*
1* 2* 3* 4*
1* 2* 3* 4* 5*
Answer:

import java.util.*; 
public class Main 
{
public void pattern(int n)
{
for(int i = n; i>0; i- -)
{
for(int j = i ; j<=n; j++)
System.out.print(j+" "); 
System.out.println( );
}
}
public void pattern(int n, char ch)
{
for(int i = 1; i<n; i++)
{
for(int j = 1; j<=i*2; j++)
{
If(j %2 == 0)
System.out.print(ch);
else
System.out.print(T');
}
System.out.println( );
}
}
public static void main(String[ ] args)
{
System.out.println("Enter the value of n"); 
Scanner sc = new Scanner(System.in); 
int n = sc.nextlnt( );
System.out.println("Enter the character"); 
char ch = sc.next( ).charAt(0);
Main ob = new Main( );
ob.pattern(n);
ob.pattern(n,ch);
}//end of main 
}//end of class

ICSE Class 10 Computer Applications Sample Question Paper 4 with Answers

Variable Data Type Description
ch char For storing character m or f
age int Age of person
inc double Income of person
tax double Store tax
cash__back double To store the cashback
cl Customer Object of class customer
str String To store line or sentence
count int Store number of words
sum double Store the sum of series
a,b,k Int Get the number.
student_name,
school_name
String Array to store student name and school name
flag int To know name exists or not
ij int For looping
n int Number of times to be printed
ch char Storing character
ob Main Object of class Main

ICSE Class 10 Computer Applications Question Papers with Answers

ICSE Class 10 Computer Applications Sample Question Paper 3 with Answers

ICSE Class 10 Computer Applications Sample Question Paper 3 with Answers

Section -I (40 Marks)
Attempt all questions

Question 1.
(a) What does the default constructor provided by the compiler do?
Answer:
Default constructor is helpful in creation of objects of the class.
E.g. ABC obj = new ABC( );

ICSE Class 10 Computer Applications Sample Question Paper 3 with Answers

(b) Name the operators listed below
(i) >=
(ii) –
(iii) !
(iv) ?
Answer:
(i) Greater than
(ii) predecrement
(iii) logical not
(iv) Ternary operator.

(c) Name
(i) A keyword used to call a package in the program.
(ii) Any reference data types
(iii) Why is an object called an instance of a class?
(iv) What are identifiers? Give example of each identifier.
Answer:
(i) import
(ii) class and arrays

ICSE Class 10 Computer Applications Sample Question Paper 3 with Answers

(d) Why is an object called an instance of a class?
Answer:
An object is called instance of class because object gets the copy of all variables defined in the class.

(e) What are identifiers? Give example of each identifier.
Answer:
Identifiers are the variables, methods classes etc. which are not independent keywords.
E.g. int a;
a is identifier.

Question 2
(A) What is the function of catch block in exception handling? Where does it appear it in a program?
Answer:
The catch block is used to find an exception and handle it. It appears after try block.

(b) Find the output:
String a = “Sidharthissmartguy”,b= “MathsMarks”;
String h = a.substring(2,5);
String k = b.substring(8).toUpperCase( );
System.out.println(h);
System.out.println(k.equalslgnoreCase(h));
Answer:
dha
false

ICSE Class 10 Computer Applications Sample Question Paper 3 with Answers

(c) (i) Name the mathematical function which is used to find sine of an angle in radians.
(ii) Name a string function which removes the blank spaces provided in the prefix and suffix of a string.
Answer:
(i) math.sin( )
(ii) trim( )

(d) Name the keyword which will be used to resolve the conflict between method parameter and instance variables/fields. Explain with example.
Answer:
this eg. void assign(inta)
{
this.b = a;
}

(e) int y = 10 ;
y+ = (++y * (y++ +5));
System.out.println(y);
What will be the output of the above code?
Answer:
186

ICSE Class 10 Computer Applications Sample Question Paper 3 with Answers

Question 3
(a) The arguments of the function given in the function definition are called_________
(b) Why JVM is required in running Java program. Justify your answer.
(c) Attempt the following
(i) Explain with example the possible loss of precision.
(ii) Explain the term type casting in java. How is it useful?
(iii) State the difference between keyword and reserved word.
(iv) What do you mean by convention and rules in java? Explain the difference between compiler and interpreter.
(v) State the purpose and return data type of the following string functions.
1. indexOf( )
2. compareTo( ).
(d) Explain the use of continue statement in looping in java.
(e) State the output of the code:
int m = 10;
int n = 10;
for(int i =1;i<5 ;i++)
m++;-n;
System.out.println(“m=”+m);
System.out.println(“n=”+n);
(f) What do you understand by Java application and java applet. Explain with example
Answer:
(a) formal parameter

(b) The JVM converts the Java program into machine code. The computer reads it and displays the output accordingly

(c) (i) float h = 3.45;
int k = (int)h;
Here k value assigned is 3.
When higher size data type is assigned to the lower size data type there is loss of data which takes place. It’s called loss of precision.

ICSE Class 10 Computer Applications Sample Question Paper 3 with Answers

(ii) Type conversion is method by which one type of data is converted into other type. It’s useful in the expression when calculation is to be done in float type.

(iii) keywords are all reserved words in java example null, true, false are reserved words.
Keywords are like return, continue, break etc.

(iv) Rules are for naming the identifiers. Example identifier name must begin with alphabet or underscore. No special character to be part of the name. Convention is the use the letter of the alphabet.

Compiler compiles the program at once and displays the error for whole program. Interpreter compiles the program line by line whenever it finds error it stops. At any time it can show only one error.

(v) An application is the program executed on the computer independently. Applet is small program uses another application program for its execution.

ICSE Class 10 Computer Applications Sample Question Paper 3 with Answers

(vi) The continue statement makes the next iteration of the loop to be executed.

(vii) a. int – return the index of a character b. int – compares two strings.

(viii) 119

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.

ICSE Class 10 Computer Applications Sample Question Paper 3 with Answers

Question 4
Digital world announces seasonal discount on the laptops in the given order.
Cost of the laptop         Discount
Rs. 20,000 – Rs. 30,000   10%
Rs. 30,000 – Rs. 40,000   15%
Rs. 40,000 – Rs. 50,000   18%
>= Rs. 50,000                 20%
An additional discount of 5%  on all types of laptops is given. Sales tax is calculated at 12% on the price after the discounts. Define a class to accept the cost of the laptop and print the amount payable by the customer on purchase (use constructor).
Answer:

import java.util.*; 
class dw 
{
double Ic, rate, stl, dst; public dw()
{
double Ic = 0.0; double rate = 0.0; 
double stl = 0.0; double dst = 0.0;
}
public static void main()
{
dw obj new dw();
Scanner sc = new Scanner(System.in);
System.out.println("Enter the cost of laptop");
obj.lc = sc.nextDouble( );
double ds = 5;
double fa = 0.0, fa 1 = 0;
if(obj.lc >=20000 && obj.lc < 30000)
{
obj.rate = 10;
}
else if(obj.lc >= 30000 && obj.lc < 40000)
{
obj.rate = 15;
}
else ifCobj.lc >= 40000 && obj.lc < 50000)
{
obj.rate = 18;
}
else if (obj.lc >= 50000)
{
obj.rate = 20;
}
else
{
System.out.println("invalid");
}
fa = obj.lc-(obj.lc*(obj.rate + ds)/100); 
fa 1 = fa + ((12.0/100.0)*fa); 
System.out.println("Amount payable:"+fa 1 ); 
}
}

ICSE Class 10 Computer Applications Sample Question Paper 3 with Answers

Question 5
Write a program in java to accept 10 integers in an array. Now display only those numbers having complete square root
Sample input: 12,45,49, 78,64, 77,81, 99,45, 33
Sample output: 49,64,81
Answer:

import java.util.*; 
class lol 
{
public static void main( )
{
Scanner sc = new Scanner(System.in); 
inta[] = new int[10]; 
System.out.println( )'Enter 10 integers:");
for(int i =0;i <a.length; i++)
{
a[i] = sc.nextlnt( );
}
for(int j = 0; jo.length; j++)
{
for(int k=0; k<=a[j]/2; k++)
{
if(k*k == a[j])
System.out.println(a[j]);
}
}
}
}

Question 6
Write a function to suppress negative elements of an array to bottom without altering the original sequence i.e if array contains 5, -4, 3, -2, 6, -11,12,-8,9Then the return array will be 5, 3,6, 12, 9,-4, -2,-11,-8.
Answer:

import java.util.*; 
class lol 
{
public static void supress( )
{
Scanner sc = new Scanner(System.in); 
int a[ ] = new int[10]; int temp;
System.out.println( )'Enter 10 integers:");
for(int i =0;i <a.length; i++)
{
a[i] = sc.nextlnt( );
}
for(int j = 0; j<a. length; j++)
{
for(int k=0; k<a.length-1 -j; k++)
{
if(a[k]<0 &&a[k+1]>0) 
{
temp = a[k]; a[k] = a[k+1]; 
a[k+1] = temp;
}
System.out.println(a[j]);
}
}
}
}

ICSE Class 10 Computer Applications Sample Question Paper 3 with Answers

Question 7
Write a program to input a sentence. Create a function convert(int n). where n is an integer value in positive or negative. This function is used to encode or decode the given by shifting each character of a string the number of times as specified by user.
Ex. input – Sid Bowler
Shift value 3
Output -Vig Erzohu
Answer:

import java.util.*; 
class lol
 {
public static void convert( ) 
{
Scanner sc = new Scanner(System.in); 
System.out.println("Enter a sentence:"); 
String str = sc.nextLine( );
String word = int n = 3; 
//shift value
for(int i =0;i <str.length( ); i++)
{
char ch = str.charAt(i); if(ch !=1')
word = word + (ch + n); else
word = word + ch;
}
System.out.println(word);
}
}

Question 8
Write a program using menu driven mode to find the value of s, where
S = 2 + 3 + 4 + 4 + 6 + 8 + 6 + 9 + 12… 100 terms S = 2! -4! +6!-8!  n
Answer:

import java.util.*; 
class lol
{
public static void main()
{
Scanner sc = new Scanner(System.in); 
double sum = 0;
System.out.println("Enter 1 for number addition and 2 for factorial summation");
int ch = sc.nextlnt( );
switch(ch)
{
case ’1int a = 2, b = 3, c = 4; 
for(int i = 3; i<=99; i+=3)
{
sum = sum + a + b + c; a = a + 2; b = b + 3; c = c + 4;
}
sum+=a;
System.out.println(sum);
break;
case '2': int k = 2;
System.out.println("Enter number of terms:"); 
int n = sc.nextlnt( ); 
for(int i = 1;i<=n;i++)
{
int fact = 1;
for(int j = 1; j<=k; j++)
{
fact = fact*j;
if(i%2 == 0) sum = sum - fact; else
sum = sum + fact; k = k + 2;
}
System.out.println(sum);
break;
default: System.out.println("Error"); break;
}
}//end of main
 }//end of class

ICSE Class 10 Computer Applications Sample Question Paper 3 with Answers

Question 9
Write a program in java to print the Pascalane triangle as follows.
ICSE Class 10 Computer Applications Sample Question Paper 3 with Answers 1
Answer:

import java.util.*; 
class lol 
{
static int fact(int n)
{
intfact=1;
for(int i = 1; i <=n; i++)
{
fact*=i;
}
return fact;
}
static int ncr(int n,int r)
{
return fact(n) / (fact(n-r) * fact(r));
}
public static void main(String args[ ])
{
System.out.println( );
int n, i,j; n = 4;
for(i = 0; i <= n; i++)
{
for(j = 0; j <= n-i; j++)
{
System.out.print(" ");
}
for(j = 0; j <= i;j++)
{
System.out.printC "+ncr(i, j));
}
System.out.println( );
}
}

ICSE Class 10 Computer Applications Sample Question Paper 3 with Answers

Variable Data Type Description
ds double Additional discount
fa 1 double Amount payable
a[ ] int Array of 10 integers
i,j,k int For looping
temp int For swapping the numbers
str String store the word
ch char store character
word String store new changed string
sum double store sum of series
abc int store consecutive integers.
k int store the multiples of 2
fact int Store the factorial.

ICSE Class 10 Computer Applications Question Papers with Answers

ICSE Class 10 Computer Applications Sample Question Paper 2 with Answers

ICSE Class 10 Computer Applications Sample Question Paper 2 with Answers

Section – A [40 Marks]
Attempt all questions

Question 1
(a) State one difference between primitive literals float and double.
(b) What is an infinite loop. Write a statement for infinite loop.
(c) Arrange the operators in the order of higher precedence.
(1)++ (2)&& (3)>= (4)%
(d) What is final variable and static variable?
(e) What is number of bytes char occupies. Write its range also.
Answer:
(a)

Float Double
Float occupies 4 bytes in memory Double occupies 8 bytes in memory

(b) An infinite loop occurs when there is no end to the iteration and loop continues to run indefinitely.
E.g. for
System.out.println(“10”);

ICSE Class 10 Computer Applications Sample Question Paper 2 with Answers

(c) ++, % >=, &&

(d) When any variable is declared using final keyword it makes the value of that variable as constant. It can’t be changed throughout the program.
E.g. final int temp = 90;
Static variable are those which can be used only by static methods. It has only single copy throughout the class.

(e) 2 bytes and its range is 0 to 65,536

Question 2
(a) What is the difference between keyword parse and function valueOf( ). Give example of each.
Answer:

Parse ValueOf
It converts a variable from string data type to another.
E.g. String a = “12”;
int b = Integer.parselnt(a);
It converts only from string to int. E.g. string a = “12”;
Int b = Integer.valueOf(a);

(b) Write a program code to accept a character input and check whether its digit using its ASCII code. Print character using suitable message.
Answer:

class abc
{
public void main( )
{
scanner sc = new scanner(system.in);
System.out.println("Enter the character to be checked");
char ch = sc.next( ).
charAt(0);
if(ch >=91 && ch <= 97)
System.out.println("Digit is "+ch); else
System.out.println("lts not a digit");
}
}

ICSE Class 10 Computer Applications Sample Question Paper 1 with Answers

(c) What do you mean by block. Give one example.
Answer:
Block is a set of statements in a program.
Eg
{
System.out.printlnC’example of block statement”);
System.out.println(“End of block statement”);
}

(d) State the difference between entry controlled loop and exit controlled loop.
Answer:

Entry Controlled Loop Exit Controlled Loop
Here condition is checked before entering the loop.
Eg. while(i<3)
{
//some statements
}
Here condition is checked after
entering the loop. First time entering
in the loop is must.
E.g.
{
}while (i< 3);

(e) Write two advantages of using function in the program. And explain role of void in declaring functions?
Answer:
Advantages:
It makes the program divides into multiple modules.
Each module is independent in executing its dedicated task.
It helps in reusability of the code once written.
void makes sure that function doesn’t return anything.

ICSE Class 10 Computer Applications Sample Question Paper 1 with Answers

Question 3
(a) What do you mean by function overloading? Explain with example.
Answer:
Function overloading is called when function with the same name is used multiple times with different arguments.
Example:

class abc
{
public: area(int a);
area(int a, int b);
area(int a, int b, float c);
}

(b) What is this keyword? Also discuss the significance of it.
Answer:

  • This keyword is used as a reference to created object for calling its methods or member functions.
  • It differentiates between instance variables from the local variables when they have the same names.

(c) Attempt the following
(i) State the two features of a constructor.
Answer:
Constructor is function which has the same name as that of class without return type. It is called whenever the object is created for the class.

(ii) Write a valid java program code to print the following array in matrix form with 2 rows and 2 columns.
int mat[ ][ ] = {{2,6},{10,20}};
Answer:

for(int i =0;i<=2;i++)
{
for(int j =0;j<=2;j++)
System.out.print(mat[i][j]);
System.out.println( );
}

ICSE Class 10 Computer Applications Sample Question Paper 1 with Answers

(iii) State the total size in bytes of the array a[4] of char data type and p[4] of float data type.
Answer:
char a[4] it occupies 8 bytes.
float p[4] it occupies 16 bytes.

(iv) String abc = “helloR”;
StringBuffer str = new StringBuffer(abc);
int num = str.capacity( );
what will variable num stores the value?
Answer:
22

(v) StringBuffer s1 = new StringBufferC’Robot”);
String s2 = s1 .reverse( );
System.out.println(“s2 =” +s2);
System.out.println(“s1 =” +s1);
Answer:
toboR
toboR

ICSE Class 10 Computer Applications Sample Question Paper 1 with Answers

(d) Write a java statement for finding and displaying the position of last space in string’str’.
Answer:
String str = “Blank”;
int a = str.lastlndexOf(‘ ‘));
System.out.println(a +” is the last position of”);

(e) Which one of the following returns the corresponding primitive data type object from string object?
(i) Integer
(ii) readLine( )
(iii) valueOf( )
(iv) endsWith( )
Answer:
(i) int
(ii) String
(iii) int
(iv) boolean

(f) What do you mean by Abstraction and information hiding in java?
Answer:
Data abstraction is the act of representing the essential features of the program without involving in its complexity.
Information hiding in java means data members which can’t be accessed directly by objects instead it has access via its member functions.

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.

ICSE Class 10 Computer Applications Sample Question Paper 1 with Answers

Question 4
Write a program to input three sides of a triangle (s1, s2, s3). Using switch case print whether a triangle is Equilateral, Isosceles, Right angled triangle or scalene. The program should be used with menu and switch-case.
Answer:

import java.util.*; 
class Triangle
{
public static void main( )
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter 3 sides of triangle ");
double s1 = sc.nextDouble( );
double s2 = sc.nextDouble( );
double s3 = sc.nextDouble( );
char ch ='0';
double sq 1 = si* si;
double sq2 = s2*s2;
double sq3 = s3 * s3;
double sum1 = sql + sq2;
double sum2 = sq2 + sq3;
double sum3 = sql + sq3;
if(s1 == s2 &&s2 == s3 )
ch = 'E';
if(s1 == s2 || s2 == s3 || s1 == s3) 
ch = I;
if(sum1 == sq3 || sum2 == sq 1 || sum3 == sq2) 
ch = 'R';
if(s1 != s2 && s2!=s3) ch = 'S'; switch(ch)
{
case 'E': System.out.println("Equilateral triangle"); break;
case T: System.out.println("lsoscless triangle"); break; 
case 'R': System.out.printlnfRight triangle"); break;
case 'S': System.out.printlnC'Scalene triangle"); break;
default: break;
}
}
}

ICSE Class 10 Computer Applications Sample Question Paper 1 with Answers

Question 5
Write a program to find the sum of the following series:
\(x+\frac{x^{2}}{2 !}+\frac{x^{2}}{3 !}+\frac{x^{4}}{4 !}+\ldots . \text { nterms }\)
Answer:

import java.util.*; 
class series 
{
public static void main( )
{
Scanner sc = new Scanner(System.in);
System.out.println("Enter a number and number of terms");
int x = sc.nextlnt( );
int n = sc.nextlnt( );
int a = 1; int f;
double sum = 0.0;
forfint i =1; i<= n; i++)
{
f = 1;
for(int j = 1; j<=i;j++)
f = f*j;
sum = sum+(Math.pow(x,a)/f);
a++;
}
System.out.printlnC'sum: "+sum);
}
}

ICSE Class 10 Computer Applications Sample Question Paper 1 with Answers

Question 6
A number is said to be NEON number if sum of digits of square of a number is equal t:o the number itself.
Example:
INPUT N = 9, Output Square: 81 (where 8 + 1 = 9 so 9 is NEON number)
Write a program to find such numbers between 10 and 10000.
Answer:

import java.util.*; 
class Neon
{
public static void main( )
{
int a = 10;
for(int i =10;i<=10000; i++)
{
intal =a; long sq = a1*a1; 
int sum =0; 
while(sq >=0)
{
int k = (int)sq % 10; 
sum = sum + k; 
sq = sq/10;
if(sum == a) 
System.out.println(a);
a++,
}
}
}

ICSE Class 10 Computer Applications Sample Question Paper 1 with Answers

Question 7
Write a program to perform binary search on the list of 10 integers entered by user in ascending order to search for an element input by user, if it’s found display the element along with its position else display the message “search element not found”.
Answer:

import java.util.*; 
class binsearch 
{
public static void main( )
{
Scanner sc = new Scanner(System.in);
System.out.priintlnfEnter the 10 no.s in ascending order to be put in the array");
int[ ] a = new int[10]; 
for(int i = 0; i< 10; i++) 
a[i] = sc.nextlnt( );
System.out.println('Enter the no. to be searched in the array");
int n = sc.nextlnt( );
int start =0,pos=0;
int last =a.length - 1;
int mid = (start + last) / 2;
int found = 0;
while(start <= last)
{
if(n == a[mid])
{
pos = mid; found = 1; break;
}
if(n < a[mid]) 
mid = last - 1; 
if(n > a[mid]) 
mid = start + 1;
}
if(found == 1)
System.out.println(n+" found at position "+pos); 
else
System.out.println(n+" not found");
}
}

ICSE Class 10 Computer Applications Sample Question Paper 1 with Answers

Question 8
Write a program to accept a word and convert into lowercase if it is in uppercase and display the new word by replacing the VOWELS with the character following it.
ex: Sample intput: VOWEL
Sample output: vpwfi
Answer:

import java.util.*; 
class strlol 
{
public static void main( )
{
Scanner sc = new Scanner(System.in);
Systenn.out.println("Enter a word");
String strl = sc.next( );
String str = strl .toLowerCase( );
String word = " ";
for(int i = 0; i <- str.length( )-1; i++)
{
char ch = str.charAt(i);
if (ch != 'a' && ch !='e' && ch != T && ch != 'o' && ch!='u') 
word = word + ch;
if(ch=='a' || ch == 'e'|| ch == 'i' || ch == 'o' || ch == 'u')
{
ch ++;
word = word + ch;
}
}
System.out.println(word);
}
}

ICSE Class 10 Computer Applications Sample Question Paper 1 with Answers

Question 9
Write a program in java to print the following output.
ICSE Class 10 Computer Applications Sample Question Paper 2 with Answers 1
Answer:

import java.util.*; 
class pattern 
{
public static void main()
{
for(int i = 5; i>= 1; i- -)
{
int a = i-1;
for(int k = 1; k <= 5-i; k++)
System.out.print(" "); 
for(int j = 1;j<= i;j++)
{
System.out.println(j+" "); 
if(a > 0)
System.out.println("*");
a- -;
}
System.out.println ( );
}
}
}

ICSE Class 10 Computer Applications Sample Question Paper 1 with Answers

Variable Data Type Description
sq1, sq2, sq3 double To find squares of each side
ch char To store the type of triangle.
x, n int Number and number of terms.
f Int Factorial storing
sum double To store sum of series.
sum Int To store sum of digits of neon number.
a[ ] int To store integers in ascending order.
n int Element to be searched.
start,last mid int Positions of index of array
found int Flag to check element is found or not.
strl string For storing string.
ch char To take out each character of string.
word String For storing the required string.
a int Number of rows.

ICSE Class 10 Computer Applications Question Papers with Answers

ICSE Class 10 Computer Applications Sample Question Paper 1 with Answers

ICSE Class 10 Computer Applications Sample Question Paper 1 with Answers

Section – A [40 Marks]
Attempt all questions

Question 1
(a) Name any four tokens of Java. [2]
(b) Give the difference between actual parameter and formal parameter. [2]
(c) What is an identifier? [2]
(d) Write an expression in Java for sin x + √a2+ b3. [2]
(e) What is the result produced by 2 – 10*3 + 100/11 ? Show the steps. [2]
Answer:
(a) Integer, boolean, double and character.

(b) Formal parameters are used in the function definition and Actual parameters are used when function is being called.

E.g. void sum(int a, int b) // a and b are formal parameters
{
System.out.println(a+b);
}
Public static void main( )
{
Sum(2,4); // 2,4 are actual parameters.
}

ICSE Class 10 Computer Applications Sample Question Paper 1 with Answers

(c) Identifiers are names of the variables, strings, classes and packages. Its values can change throughout the program.

(d) sin(x) + Math.sqrt(a*a + b*b*b);

(e) Step 1:2- 10*3 + 9
Step 2:3 – 30 + 9
Step 3: 3 – 21
Step 4: – 19

Question 2
(a) What is the difference between local variable and instance variable? [2]
(b) intx = 20, y = 10, z;
What is the value of z
in z = ++x * (y –     – y ?
Show the steps. [2]
(c) What is the purpose of default in a switch? [2]
(d) Give the difference between linear search and binary search. [2]
(e) What will be the output of the following code?
float x = 7.87;
System.out.println(Math.ceil(x));
System.out.println(Math.floor(x)); [2]
Answer:
(a)

Local Variable Instance Variable
Its scope remains inside a function or the block. Its scope remains throughout the methods of the class.
Multiple copies of this variable are used throughout the program. Every object has separate copies of this variable.

ICSE Class 10 Computer Applications Sample Question Paper 1 with Answers

(b) int x =20, y = 10, z;
z = ++x * (y – – y )- y?
Step 1:21 * 10 – 9
Step 2: 210 – 9
Step 3: 201

(c) Default in the switch statement means when no matching case is encountered by the controller it executes the default case.

(d)

Linear Search Binary Search
It compares each element of the array with rest of the elements in the array. It’s based on divide and conquer rule. Array is sorted in this search. Element is searched only in the selected halves.

e. 8.0
7.0

ICSE Class 10 Computer Applications Sample Question Paper 1 with Answers

Question 3.
(a) State the difference between if-else if ladder and switch…case. [2]
Answer:

If-else Ladder Switch Case
Works on more than one variable It works on only one variable or constant
It can hold many conditions It can hold only one condition.

(b) Explain the concept of constructor overloading with an example. [2]
Answer:
Function name same as that of class name without return type is called Constructor. Constructor overloading is when same name constructor is used with different arguments list is called constructor overloading.
Example:

Class lol
{
lol ( )
{
//write something ...
}
lol(int a)
{
//write something
}
lol(int a, int b)
{
//write something
}

(c) What will be the output of the following program segments?
(i) String s = “application”;
int p = s.indexOf(‘a’);
System.out.println(p);
System.out.println(p+s); [2]

(ii) String st = “PROGRAM”;
System.out.println(st.indexOf(st.charAt(4))); [2]

ICSE Class 10 Computer Applications Sample Question Paper 1 with Answers

(iii) int a = 0;
if(a>0 && a<20)
d++;
else a-;
System.out.println(a); [2]

(iv) int a- 5, b = 2,c;
if (a>b || a ! = b)
c = ++a+-b;
System.out.print(c+ ” “+a+” “+b); [2]

(v) int i = 1;
while(i++<=1)
{
i++;
System.out.print(i + “”);
}
System.out.print(i); [2]
Answer:
(i) Oapplication
(ii) 1
(iii) -1
(iv) 76 1
(v) 34

ICSE Class 10 Computer Applications Sample Question Paper 1 with Answers

(d) Differentiate between isUpperCase(char) and toUpperCase(char). [2]
Answer:

isUpperCase( ) toUpperCase( )
It checks whether the character is uppercase or not. It changes the character into uppercase
Return value is boolean. Return value is String

(e) What is the difference between a constructor function and a member function of a class? [2]
Answer:

Constructor Function Member Function
1. Automatically called during the creation of the object.
2. It bears the same name as that of class.
1. Class object needs to explicitly call the member functions.
2. It doesn’t have same name.

(f) What is the difference between a static member function and a member function which is not static? [2]
Answer:

Static Member Function Non Static Member Function
1. It has the keyword static before the function name.
2. It can be called by static member functions only.
1. It doesn’t have static keyword before the function name.
2. It can be called by any function.

Section – B  (60 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.

ICSE Class 10 Computer Applications Sample Question Paper 1 with Answers

Question 4
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( ) – constructor to initialize taxino to 0, name to” “and b to 0.
input( ) – 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. [15]
Answer:

import java.util.*; 
class taximeter 
{
int taxino;
String name;
int km; 
double fare; 
public taximeter ( ) 
{
taxino = 0; 
name =" "; 
km = 0; 
fare = 0.0;
}
public void input( ) 
{
Scanner sc = new Scanner(System.in);
System.out.primtlnC'Enter taxi number"); 
taxino = sc.nextlnt( ) ;
System.out.primtln("Enter passenger's name"); 
name = sc.nextLine( );
System.out.priintln("Enter number of kms travelled"); 
km = sc.nextlnt( );
}
public void calculate( ) 
{
int Rate =0; 
if (km <= 1) 
fare = 25.0 * km; 
else if(l < km && km <= 6) 
fare = 10.0 * km; 
else if(6 < km && km <= 12) 
fare = 15.0 * km; 
else if(12 < km && km <= 18) 
fare = 20.0 * km; else
fare = 25.0 * km;
}
public void display( ) 
{
System.out.priintln("Taxino "+"Name "+" kilometers travelled "+"Bill amount ");
System.out.priintln(taxino+ ""+name+""+" "+fare);
}
public void main( )
{
taximeter obj == new taximeter( ) ;
obj.input( );
obj.calculate( );
obj.display( );
} //end of main 
} //end of class

ICSE Class 10 Computer Applications Sample Question Paper 1 with Answers

Question 5
Write a menu driven program to find the sum of the following series depending on the user choosing 1 or 2
1. S=1/4+1/8+1/12………….. up to n terms
2. S=1/1!-2/2!+3/3!………….. upto n terms
where ! stands for factorial of the number and the factorial value of a number is the product of all integers from 1 to that number, e.g. 5! = 1* 2* 3* 4* 5.
Answer:

import java.util.*; class abc
 {
public void main( )
{
Scanner sc = new Scanner(System.in); 
double sum = 0.0;
System.out.println
("lnput 1 for sum first series and input 2 for sum of second series"); 
int a = sc.next.lnt(); switch(a)
{
case 1:
{
System.out.println("lnput N value for for the series"); 
int n = sc.next.lnt( ); for(int i = 1; i<= n;i++)
{
sum+ = 1,0/(4.0*i);
}
System.out.println{"sum of 1st series is "+sum);
}
break; 
case 2:
{
System.out.println("lnput N value for for the series"); 
int n = sc.next.Int( ); 
for(int i = 1; i<=n; i++)
{
int fact = 1; 
for(int j = 1; j<=i;j++)
fact*= j; 
if(i % 2 ==1) 
sum+= (double)i/fact; 
else
sum-= (double)i/fact;
}
System.out.println("sum of 2nd series is "+sum);
}
break;
default: System.out.println("not valid choice"); 
break;
} //end of switch 
}//end of main
 }//end of class

Question 6
Write a program to accept a sentence and print only the first letter of each word of the sentence in capital letters separated by a full stop.
Example:
INPUT SENTENCE :”This is a cat”
OUTPUT :T.I.A.C. [15]
Answer:

import java.util.*; 
class abc 
{
public static void main( )
{
Scanner sc = new Scanner(System.in);
System.out.println('Enter a sentence");
String str = sc.nextLine( ); 
str = str+" ";
String word = " " ;
for(int i = 0; i <=str.length( )-1;i++)
{
char ch = str.charAt(i);
 if(ch!='')
{
word = word + ch;
}
else
{
System.out.println(word.charAt(0)+"."); 
word ="";
}
}
}// end of main 
}//end of class

ICSE Class 10 Computer Applications Sample Question Paper 1 with Answers

Question 7
Write a program to create an array to store 10 integers and print the largest integer and the smallest integer in that array. [15]
Answer:

import java.util.*; 
class abc 
{
public static void main( )
{
Scanner sc = new Scanner(System.in); 
int a[ ] = new int[10];
System.out.printlnC'Enter 10 numbers:");
for(int i = 0; i < 10; i++)
a[i] = sc.nextlnt ( );
int largest = 0;
int smallest = 0;
for (int i = 0; i < 10; i++)
{
if(largest < a[i]) 
largest = a[i];
 if(smallest > a[i]) 
smallest = a[i];
}
System.out.println("Largest of number in array is "+largest); 
System.out.printlnC'Smallest of number in array is "+smallest); 
}//end of main 
}//end of class

Question 8
Write a program to calculate the sum of all the prime numbers between the range of 1 and 100. [15]
Answer:

import java.util.*; 
class prime 
{
public static void main( )
{
int sum = 0;
for(int i = 2; i <=100; i++)
{
int mid = i/2; 
int count = 0; 
for (int j = 1; j <=mid; j++)
{
if (i%j ==0)
 count++;
}
if(1 == count) 
sum+= i;
}
System.out.printlnC'sum of all prime numbers is:"+sum); 
}//end of main 
}//end of class

ICSE Class 10 Computer Applications Sample Question Paper 1 with Answers

Question 9
Write a program to store 10 names in an array. Arrange these in alphabetical order by sorting. Print the sorted list. Take single word names, all in capital letters,
E.g. SAMSON, AJAY, LUCY, etc. [15]
Answer:

import java.util.*; 
class prime
{
public static void main( ) 
{
String temp;
Scanner sc = new Scanner(System.in);
String a[ ] = new String [10];
System.out.println("Enter 10 names all in capital letters");
for (int i = 0; i < a.length; i++) 
a[i] = sc.next ( ); 
for(int i = 0; i < a.length; i++) 
for(int j = i+1;j < a.length; j++) 
{
if(a[i].compareTo(a[j])>0)
{
temp = a[i]; 
a[i] = a[j]; 
a[j] = temp;
}
}
for(int i = 0; i < a.length; i++) 
System.out.println(a[i]); 
}//end of main 
}//end of class
Variable Data Type Description
str String Input a string
word String To extract character from string
ch char To store character
a[ ] int To store integer array
temp int Temporary variable for swapping
count int To count the number of factors.
sum int To add the sum of prime numbers
n int Number to be checked whether its prime or not
largest int To store the largest value
smallest int To store the smallest value
a[] String To read all the names in capital letters.
fj int For looping
temp String For storing temporarily

ICSE Class 10 Computer Applications Question Papers with Answers

ICSE Class 9 Computer Applications Sample Question Paper 4 with Answers

ICSE Class 9 Computer Applications Sample Question Paper 4 with Answers

Section-A
(Attempt all questions)

Question 1.
(a) What is an object?
(b) Define encapsulation with an example.
(c) What do you mean by software ethics?
(d) What is hacking?
(e) What is software piracy?
Answer:
(a) An object is an instance of a class . Objects have the attributes and behaviors of their class. If country is a class then India, China and Nepal are objects of that class.

(b) Encapsulation is the wrapping up of data under a single unit. The class encapsulates all the variables and data which can be accessed by the member functions of that class .

(c) Software ethics refers to the moral principles and behavior of individuals working on computer software. It deals with many social and ethical problems.

(d) Hacking refers to unauthorized intrusion into a computer or a network. The person engaged in hacking activities is known as a hacker. This hacker may alter system or security features to accomplishes a goal that differs from the original purpose of the system.

(e) Software piracy refers to the unauthorised supplication of software. Under copyright law , software piracy occurs when copyright protected software is copied, modified, distributed or sold. It causes loss to the makers and programmers lose interest in making new creative software.

ICSE Class 9 Computer Applications Sample Question Paper 4 with Answers

Question 2.
(a) What is fall through?
Answer:
Fall through is situation that occurs in the switch case construct when the different cases are not terminated by the break statement. As a result of which all the cases occurring after the selected case gets executed until the first break statement is reached.
For example :

switch(k)
{
case 1 : System.out.print("Blue") ;
case 2 : System.out.println(''Green") ;
case 3 : System.out.println("Orange")
break;
case 4 : System.out.println("White") ;
}

Output if k == 1
Blue
Green
Orange

(b) What are the various loop statements used in Java?
Answer:
There are three loop statements used in Java are For – Loop , While Loop and Do-While
Loop for (initialization; condition; increment/decrement)

{
// loop body
}
while (condition)
{
/ / loop body
}
do
{
/ / loop body
}
while ( condition);

ICSE Class 9 Computer Applications Sample Question Paper 4 with Answers

(c) Write the uses of break statement.
Answer:
Write the uses of break statement.
The break statement are used :
(i) In loops to terminate the operation if a certain condition is reached, hence after the statement is executed, the control exits the loop.
(ii) In switch-case construct to terminate the case when all the operations in a particular case is carried out and to avoid fall through situation.

(d) What is netiquette? State two of them.
Answer:
Netiquette is a combination of the words network and etiquette. It is defined as a set of rules of acceptable online behaviour. Every user of the Internet should be careful and responsible while working on the Internet. A person should
1. Not harm anyone over the Internet in the society
2. Maintaining transparency in information policies

(e) Write two protective measures to safeguard your computer.
Answer:
Installing a good Anti-Virus software Backup of essential data

ICSE Class 9 Computer Applications Sample Question Paper 4 with Answers

Question 3.
(a) What are keywords? Give example.
Answer:
Keywords are words that have specific meaning. They cannot be used as identifier.
For example : int, if

(b) Name two rules of naming an identifier.
Answer:
The first character must be an alphabet.
Identifiers are case sensitive.

(c) What are literals? Give example.
Answer:
These are constants that have a fixed value of any of the data types.They can be number, text etc
For example, 3.9, 45

(d) What is type casting?
Answer:
(d) It is the process by which Java converts one data type to another data type. The type casting can carried out automatically (implicit) or forced ( explicit).

(e) What is special about the main( ) method?
Answer:
It is the controlling method of a program. Every program begins from main( ) method.

(f) Given the initial value of a = 20, k = 15 in the following expression
k = k + a++ + ++a/2;
Write the final value in k and a.
Answer:
k = 15 + 20 + 22/2 = 46
a= 22

ICSE Class 9 Computer Applications Sample Question Paper 4 with Answers

(g) Rewrite the following using if ..else construct switch ( ko )
case 25 : System.out.print (“Yellow”);
break;
default: System.out.print (“Purple”);
Answer:

if ( ko == 25)
System.out.print ("Yellow");
else
System.out.print ("Purple");

(h) Rewrite the following using while loop
for ( m = 75; m >= 50 ; m = m - 10)
System.out.print( k + " " );
Answer:
int m = 75;
{
while ( m >= 50 )
{
System.out.print( k + " " );
m=m - 10;
}

(i) What will be the output of the following code :
int pa = 600;
while ( pa <1000)
{
System.out.print( pa ++);
pa = pa + 100;
}
Answer:
600 ..701 ..802 ..903 ..

(j) What will be the output of the following code :
int N = 77, f = 0, status = 1;
for(f = 2; f <= N; f++)
{
( N % f == 0)
{
status = 0;
break;
}
}
System.out.print( ” Status = ” + status + ” at value of f = ” + f);
Answer:
(j) Status = 0 at value of f = 7

ICSE Class 9 Computer Applications Sample Question Paper 4 with Answers

Section – B
(Attempt Any Four)

Question 4.
In a school picnic group, there were 22 students and 3 teachers. Each person had to pay an amount of Rs 450 for food, Rs 225 for transport and Rs 175 for entertainment. The organizers profit was 10% of the entire expenditure. Calculate and print the entire expenditure and the profit of the organizer.
Answer:

import java.util.*;
public class Q 4
{
void main( )
{
int group = 25, food = 450, tms = 250, entr = 175;
int totalFood = group * food;
int totalTns = group * tms;
int totalEntr = group * food;
int Total = totalFood + totalTns + totalEntr ;
double profit = Total * 10.0/100;
System.out.println("Total expenditure = Rs " + Total);
System.out.println("Profit = Rs " + profit);
}
}

Variable Description Table

Variable Name Data type Use
group int indicating total number of people in the group
food int amount per person on food
trns int amount per person on transport
entr int amount per person on entertainment
totalFood int total amount on food
totalTns int total amount on transport
totalEtr int total amount on entertainment
Total int total amount
profit double total profit

Output
Total expenditure = Rs 28750
Profit = ₹ 2875.0

ICSE Class 9 Computer Applications Sample Question Paper 4 with Answers

Question 5.
In a library, books were given to members for 10 days. Upon late return, they were charged at a rate given below –
Days Late   (D)                      Late  Fine(F)
D <= 5                                   10
D > 5 and    D <= 10             15
D > 10                                   30
Input the number of days a member is late in returning a book. Print the late fine.
Answer:

import java.util.*;
public class Q 5
void main( )
{
Scanner sc new Scanner (System.in);
int D = 0, F = 0;
System.out.print("Enter number of days late :");
D = sc.nextlnt(); if ( D <= 5 )
{
F = 10;
}
else if( D <= 10)
{
F = 15;
}
else
F = 30;
}
System.out.println(" Number of days late " + D );
System.out.print(" Fine to pay = Rs" + F );
}
}

ICSE Class 9 Computer Applications Sample Question Paper 4 with Answers

Variable Description Table

Variable Name Data type Use
D int Input variable, number of days late
F int amount to pay as late fine

Output
Enter number of days late : 12
Number of days late 12
Fine to pay = ₹ 30

Question 6.
In a art workshop, different courses had different course code and course charge per day, as given below

Course Code Course Name Course Charge (per day)
101 Stone Painting 160
102 Origami 125
201 Bag Painting 250

Input the course code( c) and number of days(d) a student wants to enroll. Calculate and print the amount to be paid by a student. [Apply switch case construct]
Answer:

import java.util.*; public class Q6
{
void main( )
{
Scanner sc = new Scanner (System.in);
int C = 0, D = 0 , T = 0;
System.out.print("Enter the Course Code : ");
C = sc.nextlnt();
System.out.print("Enter the number of days of course :
D = sc.nextlnt();
switch ( C)
{
case 101: T = D * 160;
break;
case 102 : T = D * 125;
break;
case 201: T = D * 250;
break;
default : T = 0;
System.out.print("Sorry, no such course");
}
System.out.print(" Amount to pay = Rs " + T );
}
}

ICSE Class 9 Computer Applications Sample Question Paper 4 with Answers

Variable Description Table

Variable Name Data type Use
C int Input variable, number of days late
D int amount to pay as late fine
T int amount to pay as late fine

Output
Enter the Course  Code : 102
Enter the number of days of course : 15
Amount to pay = ₹ 1875.

Question 7.
Print the given series for n number of terms. [Input n]
1 + (1/2) + 3 + (1/4) + 5 +(1/6) + …
Answer:

import java.util.*;
public class Q 7
{
void main()
{
Scanner sc = new Scanner (System.in); int n ; double val = 0, s = 0; System.out.print("Enter the number of terms : "); - n = sc.nextlnt();
for (int t = 1; t <= n; t++)
{
if (t %2 ! = 0)
{
val = t;
else
val = 1.0 / t;
}
s = s + val;
}
System.out.print(" Sum of the series = " + s );
}
}

ICSE Class 9 Computer Applications Sample Question Paper 4 with Answers

Variable Description Table

Variable Name Data type Use
n int Input variable, number of terms
val double term value
s double sum of terms
t int loop counter

Output
Enter the number of terms : 5
Sum of the series = 9.75

Question 8.
A number is called a Cyclo number if its first and last digit is same. Input a number and verify whether it is a Cyclo Number or not. For example 52145
Answer:

import java.util.*; 
public class Q 8
{
void main( )
{
Scanner sc new Scanner (System.in);
int n = 0, d = 0, p = 1;
System.out.print("Enter a number : ");
n = sc.nextlnt( );
d = n%10; int cn = n; while ( cn>=10)
{
cn = cn/10;
}
if ( d == cn)
{
System.out.print(n + " is a Cyclo Number " );
}
else
{
System.out.print(n + " is NOT a Cyclo Number " );
}
}
}

ICSE Class 9 Computer Applications Sample Question Paper 4 with Answers

Variable Description Table

Variable Name Data type Use
n int Input variable, number of terms
d double term value
P double sum of terms
cn int loop counter

Output
Enter a number : 5206
5206 is NOT a Cyclo Number

Question 9.
Write a program to print the following pattern using nested for loop 8
Answer:

import java.util.*;
public class Q 9
{
void main( )
{
for(int r = 8; r >=4; r- -)
{
for(int c = r; c <=8; C++ )
{
System.out.print(" " + c);
}
System.out.println( );
}
}
}

ICSE Class 9 Computer Applications Sample Question Paper 4 with Answers

Variable Description Table

Variable Name Data type Use
r int to store the row number
c int to store the column number

ICSE Class 9 Computer Applications Question Papers with Answers

ICSE Class 9 Computer Applications Sample Question Paper 3 with Answers

ICSE Class 9 Computer Applications Sample Question Paper 3 with Answers

Section – A
(Attempt all questions)

Question 1.
(a) Write two features of Java.
(b) Define polymorphism with an example.
(c) How are worms harmful ?
(d) What is the difference between = and = = ?
(e) Name the arithmetic operators used in Java. Which operator does a different task in mathematics ? Explain in brief with example.
Answer:
(a) Platform Independent: Java programs can be run on any platform that has Java Virtual Machine, such as Windows, Unix etc)
Robust: It performs extensive error checking and does not let the memory get hanged.

(b) It is the ability of methods to have same name but to behave differently under different situations. For example, a student can also be an artist and a musician.

(c) A worm is responsible for memory or disk crashes. Worms work by replicating itself on the disk and taking up memory space until eventually the disk crashes.
Example : I Love You, Morris, Sobig, Mydoom worm etc.

ICSE Class 9 Computer Applications Sample Question Paper 3 with Answers

(d) = is the assignment symbol. It cannot have a literal on its left.
= = is the operator for comparison of equality. It can have variables/literals on both sides.

(e) + – * / %
% mod operator is-1 applied in calculation of percentage in mathematics.

Question 2.
(a) Write a difference between entry controlled and exit controlled loop.
(b) What are the logical operators?
(c) What is a spam?
(d) What is phishing?
(e) Rewrite the following condition using ternary operators :
if ( a < 24 )
p = 12;
else
P = 48;
Answer:
(a) Two differences between entry controlled and exit controlled loop,
entry controlled : condition is verified before execution of loop body may not get executed even once for and while loops are entry controlled
exit controlled : condition is verified after execution of loop body gets executed at least once do while loop is entry controlled !

(b) ( NOT) && ( AND) || (OR)

ICSE Class 9 Computer Applications Sample Question Paper 3 with Answers

(c) Spams are unwanted e-mails sent from unknown people. These are bulk e-mails that are sent to people generally for advertising, phishing etc. In some cases, spam may consume a lot of memory space.

(d) Phishing is the act of extracting important information from innocent users, by posing as someone reliable. Some websites carry out phishing by disguising themselves as any socially important website and then asking people to provide confidential information. This confidential information are later used for harmful purposes,

(e) p = ( a < 24) ? 12 : 48;

Question 3.
(a) What will be the output:
int K = 66, f = 2, g = 6 , rank = 1;
if ( K % f != 0 )( K %g != 0)
{
rank = 0;
}
System.out.print( ” Rank = ” + rank);
Answer:
Rank = 1

(b) Rewrite using do. .while loop :
int Q = 7, K = 10; while ( Q > 2)
K + = 2;
Q – -;
}
System.out.print(” Result = ” + K ) ;
Answer:

int Q = 7, K = 10;
do
{
K=K+2;
Q - -;
}
while (Q > 2);
System.out.print("Result = " +K);

ICSE Class 9 Computer Applications Sample Question Paper 3 with Answers

(c) What will be the output of the given code , given that Pg = 16, Pr = 22
if (( Pg >= 10 &&Pr <= 20 )) (( Pg >= 20 &&Pr <= 10 ))
{
System.out.print (“Madagaskar”);
else
{
System.out.print (“Maldives”);
}
Answer:
Maldives

(d) What is the difference between Math.floor( ) and Math.ceil() ?
Answer:
Math.floor ( ) : The largest floating-point value that is smaller than the entered number.
Example Math.floor(2.26) = 2.0
Math.ceil ( ): The smallest floating-point value that is greater than the entered number.
Example Math.ceil( 6.38) = 7.0

(e) Debug the following code and rewrite it correctly :
doublepr = ( b =! q ); 100 ? 250 :
Answer:
double pr = ( b != q ) ? 100 : 250;

(f) What is fall through ? Explain with an example.
Answer:
Fall through is a situation that occurs in the switch case construct when the different cases are not terminated by the break statement. As a result of which all the cases occurring after the selected case gets executed until the first break statement is reached.
For example :
switch (k)
{
case 1 : System.out.print(“Blue”) ;
case 2 : System.out.println(“Green”) ;
case 3 : System.out.println(“Orange”) ;
break;
case 4 : System.out.println(“White”) ;
}
Output if k == 1
Blue
Green
Orange

ICSE Class 9 Computer Applications Sample Question Paper 3 with Answers

(g) Write the output of the following code :
int W = 737, s = 0;
int cW = W;
while ( cW != 0 )
{
s = s + cW % 10;
System.out.println( ” S = ” + s );
cW = cW/10;
}
Answer:
S = 7
S= 10
S= 17

(h) Write the output of the following code :
int T = 9;
for (int n = T; n > 6; n – – )
{
int V = T * n + n ;
System.out.println( “Value = ” + V );
}
Answer:
Value =90
Value = 80
Value =70

Section – B
(Attempt Any Four)

Question 4.
Input a number in T. Calculate the print the result of the following formulae :
G = 4028 + T/4 + T2 + 8*T
Answer:
Input a number in T. Calculate the print the result of the following formulae
G = 4028 + T/4 + T2 + 8*T

import java.util.*;
public class Q5
{
void main( )
{
Scanner sc = new Scanner (System.in);
double T= 0.0, G = 0.0;
System.out.print("Enter a number : ");
T = sc.nextDouble( );
G= 4028 +, (T/ 4)+(T*T)+(8*T);
System.out.print(" Value of T = " + T + " & Result G = " + G );
}

ICSE Class 9 Computer Applications Sample Question Paper 3 with Answers

Variable Description Table

Variable Name Data type Use
T double Input variable
G double result

Question 5.
Calculate and print the value of W, by taking necessary inputs, given the following :
W = ((M – 10) + (N – 5)) / P      when P = 10
= ((M – 20) + (N – 10)) / (4*P)  when P = 20
= ((M – 5) + (N – 15)) / (2*P)    otherwise
Answer:

W = ((M - 10) + (N - 5)) / P when P - 10
= ((M - 20) + (N - 10)) / (4*P) when P = 20
= ((M - 5) + (N - 15)) / (2*P) otherwise import java.util.*; public class
Scanner sc = new Scanner (System.in); double M= 0.0, N = 0.0, W=0.0; int P=0;
System.out.println("Enter Numbers M , N : "); M = sc.nextDouble( );
N = sc.nextDouble( );
System.out.println("Enter Number P: ");
P = sc.nextlnt(); if (P - 10)
W = ((M - 10) + (N - 5)) / P; else if ( P==20 )
W = ((M - 20) + (N - 10)) / (4*P) ;
else
W= ((M - 5) + (N - 15)) / (2*P) ;
System.out.print(" Value of W = " + W );
}
}

ICSE Class 9 Computer Applications Sample Question Paper 3 with Answers

Variable Description Table

Variable Name Data type Use
M, N double Input variables
W double result

Question 6.
Create a mini calculator. Enter two numbers (say a, b). Enter a choice (say ch). Perform add, subtract, multiply and divide upon the value of choice being 1, 2, 3, 4.. Use switch..case operator.
Answer:

import java.util.* ;
public class Q7
{
void main( )
{
Scanner sc = new Scanner (System.in) ;
int a = 0, b= 0, ch=0, r=0;
System.out.println("Enter 2 numbers : ");
a = sc.nextlnt( );
b= sc.nextlnt( );
System.out.println("Enter the choice : ");
ch = sc.nextlnt( );
switch (ch)
{
case 1 : r = a + b;
break;
case 2 : r= a - b;
break;
case 3 : r= a * b;
break;
case 4 : r = a / b;
break;
default : System.out.print("Wrong Choice");
}
System.out.println("Result: " + r ) ;
}
}

Variable Description Table

Variable Name Data type Use
a, b integer Input variables
c integer Input of choice
r integer to store result

Question 7.
Print the result of the given series using a for loop.
1 + (1/2) + (1/3) + (1/4) + … upto n terms
Answer:

import java.util.* ;
public class Q8
{
void main( )
{
Scanner sc - new Scanner (System.in) ;
int n = 0; double s = 1.0;
System.out.println("Enter number of terms : ") ;
n = sc.nextlnt( );
System.out.print("1 + ") ;
for (int i=2; i <= n-1; i++)
{
System.out. print(" (l/"+i+ ") +");
s = s + (1.0 / i);
}
s = s + (1.0/n);
System.out.print(" (1/" + n +") = " + s );
}

ICSE Class 9 Computer Applications Sample Question Paper 3 with Answers

Variable Description Table

Variable Name Data type Use
n integer Input, total terms
s double to store sum
i integer loop counter

Question 8.
Input a number of type integer. Print its factors,
Answer:

import java.util.* ;
public class Q9
{
void main( )
{
Scanner sc = new Scanner (System.in);
{
int n = 0;
System.out.println("Enter a number : ");
n = sc.nextlnt( );
System.out.print("Its   factors  are:  1  ");
for(int f = 2 ; f <= (n/2); f ++)
{
if (n%f == 0)
System.out.print(" " + f ) ;
}
System.out.print('' " + n);
}
}

Variable Description Table

Variable Name Data type Use
n integer Input number
f integer loop counter

Question 9.
Print the following pattern using nested for loop :
ICSE Class 9 Computer Applications Sample Question Paper 3 with Answers 1
Answer:

import java.util.* ;
public class Q10
{
void main( )
{
for (int r =1; r <= 5; r++)
{
for (int c =3; c <= 8 - r ; C++)
System.out.print( c+ " " );
System.out.println( ) ;
}
}
}

ICSE Class 9 Computer Applications Sample Question Paper 3 with Answers

Variable Description Table

Variable Name Data type Use
r int to store the row number
c int to store the column number

ICSE Class 9 Computer Applications Question Papers with Answers

ICSE Class 9 Computer Applications Sample Question Paper 2 with Answers

ICSE Class 9 Computer Applications Sample Question Paper 2 with Answers

Section – A
(Attempt all questions)

Question 1.
(a) Write two differences between Object Oriented Programming and Procedure Oriented Programming.
(b) Define abstraction with an example.
(c) What is copyright and what is trademark ?
(d) What are Java Applets ?
(e) What are spams ?
Answer:
Follows bottom-up approach
More secure as having data hiding feature
(a) OOP : Follows bottom-up approach
More secure as having data hiding feature
POP : Follows top-down approach
Less secure as there is no way of data hiding

(b) Any representation of data in which the implementation details are hidden is known as data abstraction.
For example, a person may know how to drive a car but may not know how to repair it.

ICSE Class 9 Computer Applications Sample Question Paper 2 with Answers

(c) Copyright – It gives the right to the creator that no one can copy the same. However, someone can do the whole thing from the beginning keeping the basic idea same. Copyrighted items have a symbol of ©.
Trademark – It is a distinct name that is used for some kind of goods or services. Symbol of trademark is-©.

(d) A Java Applet is a small and efficient Java program, which is used for internet programming.

(e) These are bulk e-mails that are sent to people generally for advertising, phishing etc. In some cases, spam may consume a lot of memory space.

ICSE Class 9 Computer Applications Sample Question Paper 2 with Answers

Question 2.
(a) Write two differences between if else and switch-case constructs.
(b) Write two features of a constructor.
(c) What are increment and decrement operators ?
(d) What are comments? Give example.
(e) What is ternary operator?
Answer:
(a) if else : All relational operators can be used.
All data-types are allowed.
Multiple conditions can be connected by using logical operators.

switch-case : Only comparison of equality operator can be used.
Only integer type (byte, short, int, long) and char type data can be used.
Multiple conditions cannot be connected by using logical operators.

(b) Has the same name as the class and no return type.
Invoked directly when object is created.

(c) These operators are used to increment / decrement the value of a variable by 1.
a = 5; a++ ; / / value of a becomes 6

(d) Comments are statements that are not executed by the compiler/interpreter. They are used to provide information about parts of the code.
Single line comment / /
Multiple line comment /* ………. * /

(e) It is a single line conditional operator.
Syntax : result = Cond ? true : false;
Example : r = (a>b)?a : b;

ICSE Class 9 Computer Applications Sample Question Paper 2 with Answers

Question 3.
Answer with respect to given code :
(a) The given code has some errors. Rewrite the code correctly and underline the changes made
Switch (m)
{
case 8 : System.out.piint [88];
break;
default: System.out.print [100];
}
Answer:
(a)

switch (m)
{
case 8 : System.out.print(88);
break;
default : System.out.print(100);
}

(b) Identify the error, if any, in the following code snippet:
for ( c ==25, c < 20 , c – -)
Answer:
for ( c =25; c > 20; c – – )

(c) Identify the error, if any, in the following code snippet:
for (q = = 1; q <= 100 ; q = = q + 10 )
Answer:
for (q = 1; q <= 100; q = q + 10 )

ICSE Class 9 Computer Applications Sample Question Paper 2 with Answers

(d) What are the components of a for loop ?
Answer:
initialization
condition test
update variable

(e) What is the role of break statement in a loop ? Show a code example.
Answer:
When a break statement is encountered inside a loop, it is immediately terminated and the control comes out of the loop block and resumes at the next statement following the loop.
for(k=1;k<=6;k++)
{
System.out.print( k + ” “);
if ( k > 3)
{
break;
}
}
It will print 1  2  3

ICSE Class 9 Computer Applications Sample Question Paper 2 with Answers

(f) Write the output of the following code :
int y = 6; do
{
System.out.print( y++ + ” .. ” )
y++;
}
while ( y <= 12);
Answer:
6 ..8 ..10 ..12 ..

ICSE Class 9 Computer Applications Sample Question Paper 2 with Answers

(g) Write the output of the following code :
for ( k = 100; k > 55; k= k – 5)
{
if ( k%2 = = 0)
{
continue ;
}
System.out.print(k + ” “);
}
Answer:
95, 85, 75, 65.

Section – B
(Attempt Any four)

Question 4.
Input a number in K. Calculate the print the result of the following formulae :
W = (7*K + K2 ) / 2
Answer:

import java.util.*; public class Q5
{
void main( )
Scanner sc = new Scanner (System.in);
double K = 0.0, W = 0.0;
System.out.print("Enter a number : ");
K = sc.nextDouble( );
W = (7 * K + K*K )/ 2;
System.out.print(" Value of K = " + K + " & Result W = " + W );
}
}

Variable Description Table

Variable Name Data type Use
K double Input variable
W double Result

Output :
Enter a number : 11.5
Value of K = 11.5 & Result W = 106.375

ICSE Class 9 Computer Applications Sample Question Paper 2 with Answers

Question 5.
Input two numbers and find the max and min. Show the use of the ternary operator.
Answer:

import java.util.*;
public class Q6
{
void main( )
{
Scanner sc = new Scanner (System.in);
int nl = 0, n2 = 0, max - 0, min = 0;
System.out.print("Enter 1st number :");
n1 = sc.nextlnt( ) ;
System.out.print("Enter 2nd number
n2 = sc.nextlnt( );
max (n1 > n2) ? n1 : n2;
min = (n1 < n2) ? n1 : n2;
System.out.println(" Max of " + nl + " and " + n2 + " = " + max );
System.out.print(" Min of " + nl + " and " + n2 + " = " + min );
}
}

Variable Description Table

Variable Name Data type Use
n1, n2 int Input variables
max int Result of maximum
min int Result of minimum

Output :
Enter 1st number : 54
Enter 2nd number : 68
Max of 54 and 68 = 68
Min of 54 and 68 = 54

ICSE Class 9 Computer Applications Sample Question Paper 2 with Answers

Question 6.
Input a number and print the corresponding day of the week. Assume that a. week begins with Sunday with day number being 1. Valid day numbers are from 1 to 7. Use switch..case operator.
Answer:

import java.util.*;
public class Q7
void main ( ) throws IOException
{
Scanner sc = new Scanner (System.in);
int wn = 0;
System.out.print(”Enter day number:”);
wn = sc.nextlnt( ) ;
switch (wn)
{
case 1: System.out.print(”\n When wn = “+ wn + “ the weekday is SUNDAY.”);
break;
case 2: System.out.print(”\n When wn = “ + wn + “ the weekday is MONDAY.”);
break;
case 3: System.out.print(”\n When wn = “ + wn + “ the weekday is TUESDAY.”);
break;
case 4: System.out.print(”\n When wn =‘‚ + wn + “the weekday is WEDNESDAY.”);
break;
case 5: System.out.print(”\n When wn =“ + wn +“ the weekday is THURSDAY.”);
break;
case 6: System.out.print(”\n When wn =‘‚ + wn +“ the weekday is FRIDAY.”);
break;
case 7: System.out.print(”\n When wn = “ + wn + “ the weekday is SATURDAY.”);
break;
default: System.out.print(”\n wn = is an INVALID day number. “);
}
}
}

Variable Description Table

Variable Name Data type Use
wn int Input variable, day of week, its day number is to be printed

Output :
Enter the week number : 7
When wn = 7 the weekday is SATURDAY.
Enter the week number : 0
wn = 0 is an INVALID day number.

ICSE Class 9 Computer Applications Sample Question Paper 2 with Answers

Question 7.
Print the given series using a for loop.
10          2               30            4                  50                6       … upto n terms
Answer:

import java.util.*;
public class Q8
{
void main( )
{
Scanner sc = new Scanner (System.in);
int n = 0;
System.out.print("Enter number of terms : ");
n = sc.nextlnt( );
for (int t = 1; t<=n; t++)
{
if (t %2 != 0)
{
System.out.print(" " + (t * 10) );
}
else
{
System.out.print(" " + t);
}
}
}
}
Variable Description Table
Variable Name Data type Use
n int Input variable, number of terms
t int loop counter indicating each term in the loop

Output :
Enter number of terms : 10
10 2 30 4 50 6 70 8 90 10

ICSE Class 9 Computer Applications Sample Question Paper 2 with Answers

Question 8.
Input a number of type integer. Calculate and print the product of its digits. Use while loop.
Answer:

import java.util.*;
public class Q9
{
void main( )
{
Scanner sc = new Scanner (System.in);
int n = 0, d = 0, p = 1;
System.out.print("Enter a number : ");
n = sc.nextlnt( );
int cn = n;
while ( cn > 0)
{
d = cn%10;
P = P * d;
cn = cn/10;
System.out.print(" Product of digits of " + n + " = " + p);

Variable Description Table

Variable Name Data type Use
n int Input variable
cn int copy of n, from which digits to be taken
d int to store the digits of cn
P int to store the product of digits

Output :
Enter a number : 546
Product of digits of 546 = 120

ICSE Class 9 Computer Applications Sample Question Paper 2 with Answers

Question 9.
Print the following pattern using nested for loop.
ICSE Class 9 Computer Applications Sample Question Paper 2 with Answers 1
Answer:

import java.util.*;
public class Q9
{
void main( )
{
for (int r = 5; r <-9; r++ )
{
for (int c = r; c >=5; c - - )
{
System.out.print(" " + c);
}
System.out.println( );
}
}
}

Variable Description Table

Variable Name Data type Use
r int to store the row number
c int to store the column number

ICSE Class 9 Computer Applications Question Papers with Answers

ICSE Class 9 Computer Applications Sample Question Paper 1 with Answers

ICSE Class 9 Computer Applications Sample Question Paper 1 with Answers

Max Marks : 80
[2 Hours]

General Instructions

  • 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. O 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)

Question 1.               [5 x 2 = 10]
Answer the following in brief.
(a) Write two integer primitive data types. [2]
(b) Write two java keywords. [2]
(c) What is a token in Java ? [2]
(d) State any two harms caused by software piracy. [2]
(e) What do you mean by Intellectual property rights ? [2]
Answer:
Answer the following brief:
(a) int, double
(b) if, class
(c) Token is the smallest identifiable part of a program. For example : Keywords, Literals.
(d) Software piracy is unethical. Some of the harms caused are :
• Financial loss to the creative programmers, who make them.
• Causes hike in the general cost of the Software.
(e) Intellectual property refers to any intangible property that consists of original ideas and human knowledge.

ICSE Class 9 Computer Applications Sample Question Paper 1 with Answers

Question 2.
Answer with respect to given code. [5 x 2 = 10]
(a) What will be the value of b, c when nl = 10, n2 = 0, given that: [2]
int b = (nl < n2) ? nl : n2 ;
double c = (n2 != 0) ? (nl/n2) : (nl * 2);
Answer:
Answer with respect to given code:
(a) b = 0
c = 20

(b) Given the initial value of r = 5 in the following expression : [2]
v = r++ + 2*r + 2*r++
Write the final value in v and r.
Answer:
v = 5 + 2*6 + 2*6 =29
r = 7

(c) Given the initial value of a = 10, k = 2 in the following expression : [2]
k+ =  a++ + ++a/2;
Write the final value in k and a.
Answer:
k = 2 + (10 + 12/2) = 18
a = 12

ICSE Class 9 Computer Applications Sample Question Paper 1 with Answers

(d) Rewrite the following code after debugging (underline the changes made) : [2]
switch (wn) ;
{
case 1 : System.out.print(” Geography”);
break;
case 2 : System.out.print(“Chemistry”) break;
Default : System.6ut.print(“Mathematics”);
}
Answer:

switch (wn)
{
case 1 : System.out.print(" Geography");
break;
case 2 : System. out.print( "Chemistry")
break;
default: System.out.print("Mathematics");
}

ICSE Class 9 Computer Applications Sample Question Paper 1 with Answers

(e) Rewrite the following code after debugging (underline the changes made) [2]
for (int f = 10 , f > 5 , f++ )
{
System.out.print( f +”………”);
}
Answer:

Rewrite the following code after debugging (underline the changes made)
for (int f = 10; f > 5; f - - )
{
System.out.print (f + " ... ");
}

Question 3.
(a) Differentiate between Entry controlled and Exit controlled loop. [2]
Answer:
(a) Entry controlled and Exit controlled loop.
Entry Controlled Loop : The loop first verifies the test condition. If it is true only than it runs the loop body. For example : for loop and while loop.
Exit Controlled Loop: The loop first runs the loop body and then verifies the test condition. In this case the loop body gets executed at least once. For example : do while loop.

ICSE Class 9 Computer Applications Sample Question Paper 1 with Answers

(b) Differentiate between data type int and data type double. [2]
Answer:
(b) Data type int: This primitive datatype is used to store integers. Its default value is 0. Data type double : This primitive datatype is used to store large fractional number. Its default value is 0.0

(c) Differentiate between constructor and other methods of a class. [2]
Answer:
Constructor : They share the same name as that of the class.
They have no return type, not even void.
They are invoked upon creation of an object of the class.

Method : They have different name than that of the class.
They must have a return type.
They are invoked explicitly.

(d) Write the following code by using while loop : [4]
for (k = 501; k <= 521; k = k+2 )
{
System.out.print (” % ” + k );
}
Answer:
The code by using while loop
int k = 501;
while ( k <= 521)
{
System.out.print (” % ” + k );
k = k + 2;
}

ICSE Class 9 Computer Applications Sample Question Paper 1 with Answers

(e) Write the following code by using if .. else statement: [2]
P = ( g == 9.8) ? 0 : 1;
Answer:

The code by using if .. else statement
if ( g == 9.8)
{
p = 0;
}
else
{
p= 1;
}
p = (g== 9.8) ? 0 : 1;

ICSE Class 9 Computer Applications Sample Question Paper 1 with Answers

(f) Write the output of the following code : [4]
System.out.print(“The series is as follows – \n” ); for( int k = 710; k > 660; k – = 10)
{
System.out.println ( “XX ” + (k – 10) );
}
Answer:
The series is as follows :
XX – 700
XX – 690
XX – 680
XX – 670

(g) Write the output of the following code : [4]
double d = 100, c;
c = d;
while ( c > 20 )
{
System.out.println (“Value : : ” + c );
c – = 20;
}
Answer:
Value : : 100.0
Value : : 80.0
Value : : 60.0
Value : : 40.0

ICSE Class 9 Computer Applications Sample Question Paper 1 with Answers

Section-B
(Attempt Any Four)

Question 4.
It is puja season-and shopping season too ! You work as an employee at Small Bazaar. The owner has asked you to create an application that would quickly calculate a discount on the purchase, and also a gift. He hands you the following table for you to implement in your code:

ICSE Class 9 Computer Applications Sample Question Paper 1 with Answers 1
ICSE Class 9 Computer Applications Sample Question Paper 1 with Answers 2

Write a program that inputs the amount of purchase. Print the Amount Payable and the gift that the customer should get. [15]
Answer:

import java.util.*;
public class Q4
{
void main( )
Scanner sc = new Scanner (System.in);
double, ap=0.0, d=0.0;
int p=0;
System.out.print("Enter amount purchased: ");
p = sc.nextlnt( ); //input
if (p < 1100) / / 1st condition check
{
d= (5*p)/100.0; // calculation
System.out.print ("The gift is a wallet");
}
else if (p < 5100)
{
d= (10*p)/100.0;
System.out.print("The gift is a wrist watch");
}
else if (p < 10100)
{
d= (15*p)/100.0;
System.out.print("The gift is a wall clock");
{
d= (20*p)/100.0;
System.out.print("The gift is a travel kit");
}
ap = p - d; / /final calculation
System.out.print("The amount payable is + ap); //result printing
}
}

Variable Description Table

Variable Name Data type Use
C int Input variable, number of days late
D int amount to pay as late fine
T int amount to pay as late fine

Output
Enter the Course Code : 102
Enter the number of days of course : 15
Amount to pay = ₹ 1875

ICSE Class 9 Computer Applications Sample Question Paper 1 with Answers

Question 5.
Teacher -“What is a Nest number ?” [15]
Kabir- “A number is said to be a ‘Nest Number’ if the number contains at least one digit which is zero.”
Eg Input : 2008
Output : It is a Nest Number

Eg Input : 238
Output : Not a Nest Number
Teacher-‘great job, Kabir ! Can you write a code to check for the same ?’
Assume that you are Kabir. Write a program to input a number and check if it is a Nest number or not! [15]
Answer:

import java.util.*; public class Q5
{
void main( )
{
Scanner sc = new Scanner (System.in);
int n = 0, d = 0, f = 0;
System.out.print("Enter a number :");
n = sc.nextlnt( );
int cn = n; while ( cn > 0)
{
d = cn%10;
if (d==0)
f=1;
cn = cn/10;
}
if(f== 0)
System.out.print(" It is not a nest number");
else
System.out.print(" It is a nest number");
}
}

Variable Description Table

Variable Name Data type Use
n int Input variable, number
cn int copy number
d int to store digits
f int flag to indicate Nest number or not

Output
Enter a number : 6345
It is not a nest number.

ICSE Class 9 Computer Applications Sample Question Paper 1 with Answers

Question 6.
Write a program to print the given series : [15]
3 6 12 24 48 96 …. up to n terms
Answer:

import java.util.*;
public class Q6
{
void main( )
{
Scanner sc = new Scanner (System.in);
int n = 0, c = 6;
System.out.print("Enter the number of terms : ");
n = sc.nextlnt( );
while(n > 0)
{
System.out.print(c + " ");
n - = l;
c = c * 2;
}
}
}

Variable Description Table

Variable Name Data type Use
n int Input variable, number of terms
c int term values

Output
Enter the number of terms : 7 6 12 24 48 96 192 384

ICSE Class 9 Computer Applications Sample Question Paper 1 with Answers

Question 7.
Write a program to input n and print the following pattern [ here n = 4] [15]
ICSE Class 9 Computer Applications Sample Question Paper 1 with Answers 3
Answer:

import java.util.*;
public class Q7
{
void main( )
{
Scanner sc = new Scanner (System.in);
int n=0, r=0, c=0;
System.out.print ("Enter the number of terms:");
n = sc.nextlnt( );
for ( r = n ; r > 0; r - )
{
for (c = r; c > 0; c - -)
System.out.print("@");
System.out.println ( );
}
}
}

Variable Description Table

Variable Name Data type Use
n int Input variable, number of rows
r int outer loop counter
c int inner loop counter

ICSE Class 9 Computer Applications Sample Question Paper 1 with Answers

Question 8.
Imagine that you are a time keeper at the FI Grand Prix. You keep a record of the time taken by a car to complete a lap in seconds. For easier data keeping, the boss asks you to record the time in minutes and seconds. [15]
Write a code that takes time in seconds as input. Show the time in minutes and seconds.
Eg. Input – Time taken : 254 seconds
Output – The time taken is 4 minutes and 14 seconds
Answer:

import java.util.*;
public class Q8
{
void main( )
{
Scanner sc new Scanner (System.in);
int n = 0, m = 0, s = 0;
System.out.print("Time Taken in seconds : ");
n = sc.nextlnt( );
m = n/60;
s = n%60;
System.out.println("The time taken is" + m + "minutes and" + s + "seconds");
}
}

Variable Description Table

Variable Name Data type Use
n int Input variable, time taken in only seconds
m int time taken in minutes
s int time taken in seconds after minutes

Time Taken in seconds: 5000
The time taken is 83 minutes and 20 seconds

ICSE Class 9 Computer Applications Sample Question Paper 1 with Answers

Question 9.
Input a number and verify whether it is a Lead Number or not. A number is called a Lead number if the sum of the even digits is equal to the sum of the odd digits. For example, 1452. [15]
Answer:

import java.util.*;
public class Q9
{
void main( )
{
Scanner sc = new Scanner (System.in);
int n = 0, sed=0, sod=0, d;
System.out.println("The number is :");
n = sc.nextlnt( );;
int cn=n;
while(cn > 0)
{
d=cn%10;
if ( d % 2== 0)
sed+=d;
else
sod+=d;
cn=cn/10;
}
if( sod==sed)
System.out.println("IT IS A LEAD NUMBER");
else
System.out.println("IT IS NOT A LEAD NUMBER");
}
}

Variable Description Table

Variable Name Data type Use
n int Input number
cn int copy input
d int digit
sed int sum of even digits
sod int sum of odd digits

ICSE Class 9 Computer Applications Sample Question Paper 1 with Answers

The number is :
32452
IT IS A LEAD NUMBER.

ICSE Class 9 Computer Applications Question Papers with Answers

ICSE Class 9 Chemistry Sample Question Paper 10 with Answers

ICSE Class 9 Chemistry Sample Question Paper 10 with Answers

Section -1
(Attempt all questions from this section)

Question 1.
(a) Fill in the blanks with the correct choice given in brackets.
(i) ………….. . does not support combustion. [hydrogen/oxygen]
(ii) A reducing agent is an………………… of electrons. [acceptor/donor]
(iii) The reaction of photosynthesis is an…………… reaction, [endothermic/exothermic]
(iv) …………. water forms lather with soap. [Hard /Soft]
(v) The…………… temperature is called absolute zero. [+ 273°C/- 273°C]
Answer:
(i) Hydrogen
(ii) Donor
(iii) Endothermic
(iv) Soft
(v) – 273°C

ICSE Class 9 Chemistry Sample Question Paper 10 with Answers

(b) Choose the correct answer from the options given below :
(i) (Choose the air pollutant which is non-acidic.
(A) NO2
(B) SO2
(C) SO3
(D) Ozone
Answer:
(D) Ozone                                              ‘

(ii) Choose the odd one.
(A) HCl
(B) H2CO3
(C) HNO3
(D) H2SO4
Answer:
(A) HCl

(iii) On adding water to sodium, the solution formed is :
(A) Neutral
(B) Alkaline
(C) Acidic
(D) Amphoteric
Answer:
(B) Alkaline

ICSE Class 9 Chemistry Sample Question Paper 10 with Answers

(iv) According to Boyle’s law, as the pressure increases, the volume :
(A) Increases
(B) Decreases
(C) Remains the same
(D) First increases and then decreases
Answer:
(B) Decreases

(v) In the element 11Na23,11 represents :
(A) Mass number
(B) Atomic number
(C) Number of neutrons
(D) None of the above
Answer:
(B) Atomic number

(c) Give the valency and the formula of the following radicals :
(i) Sulphate
(ii) Sulphite
(iii) Sulphide
(iv) Carbonate
(v) Ammonium
Answer:

Formula Valency
(i) SO42- -2
(ii) SO32- -2
(iii) S2- -2
(iv) CO32- -2
(v) NH4- +1

(d) An element ‘M’ has three electrons more than the noble gas. Give the formula of its.
(i) Chloride
(ii) Sulphate
(iii) Hydroxide
(iv)  Phosphate
(v) Oxide
Answer:
The outermost shell of all the noble gases is complete. Thus, its valency is zero. ‘M’ has three electrons more than the noble gas. Thus, the valency of the element ‘M’ is +3.
(i) MCl3
(ii) M2(SO4)3
(iii) M(OH)3
(iv) MPO4
(v) M2O3                                                                                                    ‘

(e) Correct the following statements.
(i) A molecular formula represents an element.
(ii) The molecular formula of water (H2O) represents nine parts by mass of water.
(iv) A balanced equation obeys the law of conservation of mass and so does an imbalanced equation.
(v) A molecule of an element is always monoatomic.
(vi) CO and Co both represent cobalt.
Answer:
(i) A molecular formula represents a molecule.
(ii) Molecular formula of water (H2O) represents eighteen parts by mass of water.
(iii) A balanced equation obeys the law of conservation of mass, while an unbalanced equation does not obey this law.
(iv) A molecule of an element is not always monoatomic.
(v) CO and Co represent carbon monoxide and cobalt, respectively.

ICSE Class 9 Chemistry Sample Question Paper 10 with Answers

(f) (i) What is a solubility curve ?
(ii) Write down two applications of solubility curve.
(iii) 12 g of a saturated solution of potassium chloride at 20°C, when evaporated to dryness, leaves a solid residue of 3 g. Calculate the solubility of potassium chloride.
Answer:
(i) A solubility curve is a line graph that plots changes in solubility of a solute in a given solvent against changing temperature.

(ii) Applications of solubility curve :
1. Shape of the curve indicates how the solubility of the given substance in a solvent varies with change in temperature. The solubility of a substance at a particular temperature can be determined from the curve.
2. The effect of cooling of hot solutions of different substances can be found from the curves.

(iii) Weight of water in solution = 12g – 3g = 9g
9g of water dissolves 3g of solid
Therefore 100 g of water will dissolve = \(\frac{3}{9} x 100 = 33.3 g\)
Solubility of KCl in water at 20°C is 33.3 g.

(g) Give reasons for the following.
(i) Electrovalent compounds conduct electricity in molten or aqueous state.
(ii) Electrovalent compounds have high melting and boiling points, while covalent compounds have low melting and boiling points.
(iii) 1. Electrovalent compounds dissolve in water, whereas covalent compounds do not.
2. Polar covalent compounds conduct electricity.
3. Electrovalent compounds are usually hard crystals yet brittle.
Answer:
(i) 1. They are good conductors of electricity in the fused or aqueous state because electrostatic forces of attraction between ions in the solid state are very strong, and these forces weaken in the fused state or in the solution state. Hence, ions become mobile.

ICSE Class 9 Chemistry Sample Question Paper 10 with Answers

2. In electrovaient compoimds, there exists a strong force of attraction between the oppositely charged ions, and a large amount of energy is required to break the strong bonding force between ions. So, they have high boiling and melting points. In covalent compounds, weak forces of attraction exist between the binding molecules, thus less energy is required to break the force of binding. So, they have low boiling and melting points.

(ii) 1. As water is a polar compound, it decreases the electrostatic forces of attraction, resulting in free ions in aqueous solution. Hence, electrovalent compounds dissolve. Covalent compounds do not dissolve in water but dissolve in organic solvents. Organic solvents are non-polar; hence, these dissolve in non-polar covalent compounds.

2. Polar covalent compounds conduct electricity because they form ions in their solutions.

3. Electrovaient compounds are usually hard crystals yet brittle because they have strong electrostatic forces of attraction between their ions which cannot be separated easily.

ICSE Class 9 Chemistry Sample Question Paper 10 with Answers

(h) Match Column A with Column B.

Column A Column B
(i) Plaster of Paris (A) Electrovalent compound
(ii) Nad (B) Polar compound
(ii) Nad (B) Polar compound
(v) Hydrogen chloride (E) Non polar compound

Answer:
(i) (D)
(ii) (A)
(iii) (E)
(iv) (B)
(v) (C)

Section – II
(Attempt any four questions from this section)

Question 2.
(a) Explain the Rutherford’s alpha particles scattering experiment with the help of a diagram.
(b) How temporary hardness’s removed by Clark’s process and also explain why removal of temporary hardness by boiling water is not a practical method ?
(c) According to the activity series, which of the following can successfully displace hydrogen ? K/Na/Pb/Ag/Pt/Fe/Al.
Answer:
(a) In 1911, Earnest Rutherford, a scientist from New Zealand, overturned Thomson’s atomic model by his gold foil experiment. His experiment demonstrated that the atom has a tiny massive nucleus. It thus rejected Thomson’s model of the atom.
Rutherford’s scattering experiment
1. Rutherford selected a gold foil as he wanted a very thin layer.
2. In his experiment, fast-moving alpha particles were made to fall on a thin gold foil.
3. Alpha particles are helium ions with +2 charges and have a considerable amount of energy.
4. These particles were studied by the flashes of light they produced on striking a zinc sulphide screen.
5. He expected the alpha particles to pass through the gold foil with little deflections and to strike the fluorescent screen.
ICSE Class 9 Chemistry Sample Question Paper 10 with Answers 1

Main features of Rutherford’s theory of atom are :
1. There is a positively charged centre in the atom called the nucleus in which nearly all the mass of the atom is concentrated.
2. Negatively charged particles called electrons revolve around the nucleus in paths called orbits.
3. The size of the nucleus is very small as compared to the size of the atom.
4. His model can be compared to the solar system, where the planets are compared with electrons and the sun with the nucleus.

ICSE Class 9 Chemistry Sample Question Paper 10 with Answers

(b) Removal of temporary hardness by Clark’s process is also known by the name by addition of lime. In this method lime is first thoroughly mixed with water in a tank and fed into another tank containing the hard water. Revolving paddles thoroughly mix the two solutions. Most of the calcium carbonate settles down. If there is any solid left over, it is removed by a filter. In this process the following reactions takes place.
Ca(HCO3)2 + Ca(OH)2 → 2CaCO3 + 2H2O
Mg(HCO3)2 + Ca(OH)2 MgCO3 + CaCO3 + 2H2O
Temporary hardness is called temporary because the temporary hardness of water can be removed just by boiling. But it is not a practical method to do, because it is slow and very costly.

(c) K and Na can displace hydrogen from acids by reacting violently.
Pb displaces hydrogen from only hot concentrated acids.
Ag and Pt do not displace hydrogen from acids at all.
Fe displaces hydrogen gently from acids.
A1 displaces hydrogen from acids vigorously.

ICSE Class 9 Chemistry Sample Question Paper 10 with Answers

Question 3.
(a) Write a note on discovery of protons and also write two properties of anode ray.
Answer:
(a) Goldstein scientist noticed another set of rays travelling in a direction opposite to that of cathode rays. These rays travel from anode to cathode. He called these rays as canal rays since these rays passed through holes or “canals” in the cathode. These rays were named as positive rays or anode rays. Anode rays travel in a straight line and are deflected by electric and magnetic fields but in a direction opposite to that of the cathode rays. This shows that these rays consist of positively charged particles called protons.

Properties of anode rays :
1. Anode rays consist of minute material particles and hence produce mechanical effects.
2. These rays produce fluorescence on a zinc sulphide screen.

(b) Under what conditions can hydrogen be made to combine with ?
(i) Nitrogen
(ii) Chlorine
(iii) Sulphur
(iv) Oxygen
Name the products in each case and write the equation for each reaction.
Answer:
(i) Three volumes of hydrogen and one volume of nitrogen react at temperature 450- 500°C and pressure 200-900 atm in the presence of a finely divided iron catalyst with molybdenum as promoter to give ammonia.
\(\mathrm{N}_{2}+3 \mathrm{H}_{2} \rightleftharpoons 2 \mathrm{NH}_{3}\)

(ii) Equal volumes of hydrogen and chlorine react slowly in diffused sunlight to form hydrogen chloride.
H2 + Cl2 → 2HCl

(iii) Hydrogen gas on passing through molten sulphur reacts to give hydrogen sulphides.
H2 + S → H2S

(iv) Hydrogen bums in the presence of electric spark with a ‘pop’ sound in oxygen and with a blue flame forming water.
2H2 + O2 → 2H2O

ICSE Class 9 Chemistry Sample Question Paper 10 with Answers

(c) The formula of the chloride of a metal ‘M’ is MCl2. State the formula of its :
(i) Carbonate
(ii) Nitrate
(iii) Hydroxide.
Answer:
(i) MCO
(ii) M(NOs)2
(iii) M(OH)2

Question 4.
(a) Two neutral gases ‘A’ and ‘B’ undergo a synthesis reaction to form a gas ‘C’.
(i) Identify ‘A’, ‘B’ and ‘C’.
(ii) Name the process by which gas ‘C’ is manufactured. Give the balanced chemical equation along with the conditions.
(iii) What do you observe when gas ‘C comes in contact with ?
(1) Moist red litmus paper,
(2) Concentrated hydrochloric acid.
Answer:
(a) (i) A – Nitrogen B – Hydrogen C – Ammonia
(ii) Gas ‘C’ is manufactured by the Haber process.
N2 + 3H2 → 2NH3 + Heat

Favourable conditions :

  1. Temperature should be between 450°C and 500°C.
  2. Pressure should be high (200-1000 atm.).
  3. Promoter used should be molybdenum.

(iii) It turns moist red litmus blue.
ICSE Class 9 Chemistry Sample Question Paper 10 with Answers 2

(b) What do you understand by the combining capacity of atoms? Explain with examples.
Answer:
An atom of each element has a definite combining capacity called its valency. The combining capacity of the atoms, i.e., their tendency to react and form molecules with atoms of the same or different elements, was explained as an attempt to attain a fully filled outermost shell of electrons.

This is done by sharing, gaining or losing electrons. For example, lithium and sodium atoms contain one electron each in their outermost shell; therefore, each of them can lose one electron to have 8 electrons in their outermost shell. So, they are said to have valency = 1.

ICSE Class 9 Chemistry Sample Question Paper 10 with Answers

(c) What is meant by :
(i) electronic configuration,
(ii) atomic number
(iii) atomic mass number
Answer:
(i) Electronic configuration is the arrangement of electrons in the atomic or molecular orbitals of atoms or molecules.
(ii) Atomic number of elements is the number of protons in an atom of the element.
(iii) Atomic mass of an element is the total mass of electrons, protons and neutrons in one atom of the element.

Question 5.
(a) What is the effect of increasing and decreasing pressure on the solubility of a gas in a liquid ?
Answer:
On increasing pressure the solubility of a gas in a liquid increases whereas, on decreasing pressure the solubility of a gas in a liquid decreases. This shows the mass of a given volume of a gas which dissolves in liquid at constant temperature is directly proportional to the pressure on the surface of the liquid and thus in accordance with Henry’s law.

(b) State which salts increase in weight, decrease in weight or remain the same when exposed to the atmosphere.
(i) Sodium hydroxide
(ii) Ferric chloride
(iii) Green vitriol
(iv) Cone, sulphuric acid
Answer:
(i) Increases
(ii) Increases
(iii) Decreases
(iv) Increases

ICSE Class 9 Chemistry Sample Question Paper 10 with Answers

(c) Why is it necessary to compare gases at STP ?
Answer:
The volume of a given mass of dry enclosed gas depends on the pressure of the gas and the temperature of the gas in Kelvin, so to express the volume of the gases, we compare these to STP.

Question 6.
(a) How does the modern atomic theory contradict and correlate with Dalton’s atomic theory ?
Answer:
Dalton was right that atoms take part in chemical reactions.
Comparisons of Dalton’s atomic theory with the modem atomic theory.
Dalton’s atomic theory :
1. Atoms are indivisible.
2. Atoms of the same element are similar in every respect.
3. Atoms combine in a simple whole number ratio to form molecules.
4. Atoms of different elements are different.
5. Atoms can neither be created nor be destroyed.

Modem atomic theory :
1. Atoms are no longer indivisible and consist of electrons, protons, neutrons and even more sub-particles.
2. Atoms of the same element may differ from one another called isotopes.
3. Atoms of different elements may be similar called isobars.
4. Atoms combine in a ratio which is not a simple whole number ratio; e.g., in sugar, the C12H22O11 ratio is not a whole number ratio.

(b) Classify the following as homogeneous or heterogeneous and give one example of each :
(i) Solid-Solid
(ii) Solid-Liquid
(iii) Gas-Gas
(iv) Liquid-Liquid
(v) Gas-Solid
Answer:

Constituents of mixture Nature of mixture Examples
(i) Solid-Solid Homogeneous Alloys
(ii) Solid-Liquid Homogeneous Salt in water
(iii) Gas-Gas Homogeneous Air
(iv) Liquid-Liquid Homogeneous Milk in water
(v) Gas-Solid Heterogeneous Smoke

(c) Draw the orbit structure for each of the following compounds :
(i) Methane [H = 1, C = 6]
(ii) Magnesium chloride [Mg = 12, Cl = 17]
Answer:
(i) Orbit structure of methane
ICSE Class 9 Chemistry Sample Question Paper 10 with Answers 3
(ii) Orbit structure of magnesium chloride
ICSE Class 9 Chemistry Sample Question Paper 10 with Answers 47
The two electrons lost by a magnesium atom are gained by chlorine atoms to produce a magnesium ion and two chloride ions.

ICSE Class 9 Chemistry Sample Question Paper 10 with Answers

Question 7.
(a) Give reasons for the following :
(i) Hydrogen shows dual nature
(ii) Gases diffuse rapidly.
(iii) Rivers and lakes do not freeze easily ?
Answer:
(i) Hydrogen shows dual nature because it resembles the alkali metals of group LA and the halogens of group VELA.
(ii) Gases have maximum intermolecular space. Therefore, when two gases are brought in contact, they readily fill the intermolecular spaces and form a homogeneous mixture.
(iii) Rivers and lakes have a large amount of water, and water has high specific heat capacity due to which it does not freeze easily. Even if water freezes, it freezes into ice on the surface (at the top) of rivers and lakes. Water is present below because of anomalous expansion of water.

(b) Name the solvent for the following precipitates :
(i) Silver chloride
(ii) Lead sulphate
(iii) Lead chloride
Answer:
(i) Ammonium hydroxide
(ii) Ammonium acetate
(iii) Soluble in hot water

ICSE Class 9 Chemistry Sample Question Paper 10 with Answers

(c) What is latent heat of vapourization ?
Answer:
Latent heat of vapourization is the heat energy required to change 1 kg of a liquid to a gas at atmospheric pressure at its boiling point.

ICSE Class 9 Chemistry Question Papers with Answers

ICSE Class 9 Chemistry Sample Question Paper 9 with Answers

ICSE Class 9 Chemistry Sample Question Paper 9 with Answers

Section -1
(Attempt all questions from this section)

Question 1.
(a) Fill in the blanks with the correct choice given in brackets.
1. Mass number of an element is the total number of………………… and neutrons present in its nucleus.  [protons/electrons]
2. ……………….. and ………………… are bridge elements. [Li and Mg/Na and Ca]
3. The chemical reaction in which heat is liberated is known as………………… [endothermic/exothermic]
4. The electrons present in the ………………. shell of an atom are called valence electrons. [innermost/outermost]
5. The molecular formula of quick lime is……………… [Ca(OH)2/CaO]
Answer:
(i) Protons
(ii) Li and Mg
(iii) Exothermic
(iv) Outermost
(v) Ca(OH)2

ICSE Class 9 Chemistry Sample Question Paper 9 with Answers

(b) Choose the correct answer from the options given below :
(i) The gas that prevents haemoglobin from carrying blood to different parts of the body is :
(A) Sulphur dioxide
(B) Carbon monoxide
(C) Hydrogen sulphide
(D) Methane
Answer:
(B) Carbon monoxide

(ii) According to Mendeleev’s periodic law the physical and chemical properties of elements are a periodic function of their :
(A) Atomic number
(B) Atomic masses
(C) Atomic weight
(D) Mass number
Answer:
(B) Atomic masses

ICSE Class 9 Chemistry Sample Question Paper 9 with Answers

(iii) The specific value of the amount of heat energy required by ice to change into water is :
(A) 336 J/g
(B) 80 cal/g
(C) 2268 J/g
(D) Both A and B
Answer:
(D) Both A and B

(iv) The graph of PV vs. P for a gas is :
(A) Parabolic
(B) Hyperbolic
(C) A straight line parallel to x
(D) A straight line parallel to y axis
Answer:
(C) A straight line parallel to x

ICSE Class 9 Chemistry Sample Question Paper 9 with Answers

(v) The property which is a characteristic of an equivalent compound is :
(A) They are weak electrolyte.
(B) They are non-volatile.
(c) They conduct electricity in the solid state.
(D) They are soluble in organic solvents.
Answer:
(B) They are non-volatile.

(c) Name the gas evolved in each of the following cases :
(i) When zinc reacts with dilute sulphuric acid.
(ii) When copper carbonate decomposes on heating.
(iii) When chlorine is exposed to sunlight.
(iv) When an electric current is passed through accumulated water.
(v) When nitrogen tetraoxide is heated.
Answer:
(i) Hydrogen
(ii) Carbon dioxide
(iii) Oxygen
(iv) Hydrogen and Oxygen
(v) Nitrogen dioxide

ICSE Class 9 Chemistry Sample Question Paper 9 with Answers

(d) Give a reason for each of the following :
(i) Why elements of group numbers 3 to 12 are known as transition elements ?
(ii) Why the valency of all elements in a group is same ?
(iii) Why hydrogen is called inflammable air ?
(iv) Why washing soda when exposed to dry air becomes a monohydrate ?
(v) Why group 1 elements in periodic table are known as alkali metals ?
Answer:
(i) Elements of group numbers from 3 to 12 are known as transition elements because they have their two outermost shells incomplete.

(ii) Since elements in a particular group have an equal number of electrons in their respective valence shells, thus the valency of all elements in a group is same.

(iii) Hydrogen gas is called inflammable air because of its combustible nature.

(iv) Washing soda when exposed to dry air becomes a monohydrate because it loses its water of crystallisation.

(v) Group 1 elements are known as alkali metals because they react with water to form their hydroxides which are strong alkalies.

(e) What do you observe when :
(i) Alkali metals react with water.
(ii) Halogens react directly with metal.
(iii) Aluminium reacts with steam.
(iv) The temperature of sodium nitrate, potassium nitrate and potassium bromide is increased.
(v) Iron nails are added to blue coloured copper sulphate solution.
Answer:
(i) They react with water to produce hydrogen.
2M + 2H2O → 2MOH + H2 Where M is alkali metal.
(ii) They form metal halides or salts.
(iii) It liberates hydrogen.
(iv) When the temperature is increased their solubility decreases.
(v) The blue colour of the solution fades and eventually turns into light green due to formation of ferrous sulphate.

ICSE Class 9 Chemistry Sample Question Paper 9 with Answers

(f) (i) State Charle’s law.
(ii) Write 2 behaviour and characteristics properties of gases.
(iii) Give the mathematical form of the Boyle’s law.
Answer:
(i) Charle’s law may be stated as volume of a given mass is directly proportional to its absolute temperature, if the pressure remains constant.
\(\frac{\mathrm{V}_{1}}{\mathrm{~T}_{1}}=\frac{\mathrm{V}_{2}}{\mathrm{~T}_{2}}=\mathrm{K} = K\) (at constant pressure)
Where V1 is volume occupied by gas 1 at temperature T1 and V2 is volume occupied by gas 2 at temperature T2.

(ii) Behaviour and characteristics properties of gases are as follows :

1. Gases have low density : The number of molecules per unit volume in a gas is very small as compared to solids and liquids. Gases have large inter molecular space between their molecules. Therefore they have low density.

2. Gases exert pressure in all directions : The moving particles of gas collide with each other and also in the container that is why they exert pressure in all directions.
\(\mathrm{V}_{1}=\frac{\mathrm{K}}{\mathrm{P}_{1}}\) (at constant temperature)
Or P1V1 = P2V2

(g) (i) Balance each of the following chemical equations given below :
1. KMnO4 + H2SO4 → K2SO4 + MnSO4 + H2O + [O]
2. Al2O3 → Al + O2
Answer:
1. 2KMnO4 + 3H2SO4 → K2SO4 + 2MnSO4 + 3H2O + 5[O]
2. AIP3 → 4A1 + 3O2

(ii) Identify the substance which matches the description given below :
(1) It catches fire and bums with a lilac-coloured flame and produces hydrogen when reacted with water.
(2) It acts as a dehydrating agent and removes water molecule from blue vitriol.
(3) The metals that cannot displace hydrogen from dilute hydrochloric acid.
Answer:
1. Potassium when reacts with water bums with a lilac coloured flame.
2K + 2H2O → 2KOH + H2

2. Conc. H2SO4 removes water molecules from blue vitriol and acts as a dehydrating agent.
ICSE Class 9 Chemistry Sample Question Paper 9 with Answers 1
3. Metals like Cu, Ag and Au.

ICSE Class 9 Chemistry Sample Question Paper 9 with Answers

(h) Match Column A with Column B.

Column A Column B
(i) Alkaline earth metals (A) Cone. H2SO4
(ii) Green house gases (B) Argon, Neon, Helium
(iii) Dehydrating agent (C) K, L, M, N, O, P, Q
(iv) Inert gases (D) CO2, N2O
(v) Caustic soda (E) NaOH

Answer:
(i) (C)
(ii) (D)
(iii) (A)
(iv) (B)
(v) (E)

Section – II
(Attempt any four questions from this Section)

Question 2.
(a) Consider M is any alkali metal. Give the general equation as well as explanation of the following :
(i) When M reacts with acids.
(ii) When M reacts with water.
(iii) When M reacts with air.
Answer:
(a) (i) Li, Na, K, Rb, Cs, Fr are all alkali metals.
When M reacts with acids the following action takes place.
2M + 2HCl → 2MCl + H2
They react violently with dil. HCl and dil. H2SO4 to produce hydrogen.

(ii) When M reacts with water the following action takes place.
2M + 2H2O → 2MOH + H2

(iii) When M reacts with air the following action takes place.
4M + O2 → 2MO
MO +H2O → 2MOH
They react rapidly with oxygen and water vapour in the air.

(b) Write the balanced chemical equation of the following :
(i) Lead nitrate when heated.
(ii) Ammonium and hydrogen chloride combines.
(iii) Reaction of iron with chlorine.
Answer:
(i) \(2 \mathrm{~Pb}\left(\mathrm{NO}_{3}\right)_{2} \stackrel{\text { (Heät) }}{\longrightarrow} 2 \mathrm{PbO}+4 \mathrm{NO}_{2}+\mathrm{O}_{2}\)
Lead nitrate decomposes on heating leaving a yellow residue lead monoxide, brown
gas nitrogen dioxide and colourless gas oxygen.

(ii) Ammonium and hydrogen chloride both compounds combine to form a new
compound ammonium chloride.
NH3(g) + HCl(g) → NH4Cl(s)

(iii) When iron reacts with chlorine iron (Ill) chloride salt is formed.
2Fe + 3Cl2→ 2FeCl3

(c) Draw the orbit structure for each of the following compounds and also write their electronic configuration and valency.
(i) Boron
(ii) Neon
(iii) Fluorine
(iv) Hydrogen
Answer:
ICSE Class 9 Chemistry Sample Question Paper 9 with Answers 4

Question 3.
(i) Write two similarities between hydrogen and halogens.
(ii) How hydrogen is produced from cold water ?
Answer:
(i) Similarities between hydrogen and halogen are :

  1. Hydrogen and halogen have one electron less than the nearest inert gas.
  2. Both have valency 1, they accept 1 electron of the nearest inert gas to attain the electronic configuration.

(ii) Among the reactive metals sodium reacts with cold water and form their corresponding hydroxides evolving hydrogen. The reaction is exothermic and vigorous.
2Na + 2H2O → 2NaOH + H2

ICSE Class 9 Chemistry Sample Question Paper 9 with Answers

(b) (i) What is Newland’s law of octaves ?
(ii) Write two drawbacks of Newland’s law of octaves ?
(iii) Write two merits of Newland’s classification.
Answer:
(i) According to Newland’s law of octaves, “When elements are arranged by increasing atomic mass, the properties of every eighth element starting from any element are a repetition of the properties of the starting element”.

(ii) Drawbacks of Newland’s law of octaves are :
1. This classification did not work with heavier elements i.e., those lying beyond calcium. As more and more elements are discovered, they could not fit into Newland’s Law.
2. Iron which resembles, with cobalt and nickel in properties has been placed far away from those elements.

(iii) 1. It relates the properties of the elements to their atomic masses.
2. For the first time it is shown that there is a distinct periodicity in the properties of elements.

(c) Write the merits of the modem periodic table.
Answer:
Merits of the modem periodic table are as follows :
1. It is based on atomic number, which is an even better fundamental property compared to atomic mass.
2. Position of an element in the table is related to its electronic configuration.
3. It shows regular changes in properties of elements on moving across a period or down a group.
4. Modem periodic table is easier to remember, understand and reproduce.

Question 4.
(a) 120 cm3 of a gas is taken at 27.3 K. The temperature is then raised to 0°C. What is the new volume of the gas ? The temperature is kept constant.
Answer:
ICSE Class 9 Chemistry Sample Question Paper 9 with Answers 6

(b) Calculate the final volume of a gas ‘X’ if the pressure of the gas, originally at STP, is doubled and its temperature is made three times.
Answer:
ICSE Class 9 Chemistry Sample Question Paper 9 with Answers 5

(c) Calculate the relative molecular mass of each of the following :
(i) Ammonia (NH3)
(ii) Tricalcium phosphate Ca3(PO4)2
Answer:
(i) To find the molecular mass of NH3, the first step is to look up the atomic masses of nitrogen and hydrogen.
Atomic mass of nitrogen = 14.0067 Atomic mass of hydrogen = 1.00794
Next, multiply the atomic mass of each atom by the number of atoms in the compound. There is one nitrogen atom (no subscript is given for one atom). There are three hydrogen atoms, as indicated by the subscript.
Molecular mass = (1.x 14.0067) + (3 x 1.00794)
Molecular mass = 14.0067 + 3.02382 = 17.0305

(ii) From the periodic table, the atomic masses of each element are :
Ca = 40.078 P = 30.973761
O = 15.9994
The tricky part is figuring out how many of each atom are present in the compound. There are three calcium atoms, two phosphorus atoms, and eight oxygen atoms.

To get the part of the compound which is in parentheses, multiply the subscript immediately following the element symbol by the subscript that closes the parentheses.
Molecular mass = (40.078 x 3) + (30.97361 x 2) + (15.9994 x 8)
Molecular mass = 120.234 + 61.94722 + 127.9952 = 310.17642 = 310.18

ICSE Class 9 Chemistry Sample Question Paper 9 with Answers

Question 5.
(i) Write the electronic configuration of the following :
(1) { }_{20}^{40} \mathrm{Ca}
(2) { }_{32}^{16} \mathrm{S}
(ii) What is an atom ?
(iii) What are protons ?
Answer:
(i) 1. Is2 2s2 2f 3s2 3p6 4s2
2. Is2 2s2 2f 3s2 3p4

(ii) An atom is the smallest particle of an element that exhibits all the properties of that element. It may or may not exist independently but takes part in every chemical reaction.

(iii) Proton may by defined as a sub-atomic particle having mass 1 amu, e., equal to hydrogen atom and has unit positive charge.

(b) (i) What do you understand by the term Isobars ? Give examples.
(ii) What is a neutron ?
(iii) What is an atom ? Write its structural parts.
Answer:
(i) Isobars are atoms of different elements with the same mass number, but different atomic numbers. Since the properties of elements depend upon atomic number, so they have both different physical and chemical properties.
Examples : 40S, 40C1, 40Ar, 40K and 40Ca. The nuclei of these nuclides all contain 40 nucleons; however, they contain varying numbers of protons and neutrons.

(ii) A neutron is a sub-atomic particle or fundamental particle of an atom with no charge and mass almost equal to the mass of proton e., hydrogen atom. Neutron is denoted by pn1. The subscript 1 represents its mass and subscript 0 represents its electrical charge.

ICSE Class 9 Chemistry Sample Question Paper 9 with Answers

(iii) An atom is built up of a number of sub-atomic particles e., electrons, protons and neutrons. Electron has charge -1, proton has charge +1 and neutron has charge 0. There are two structural parts of an atom-the nucleus and orbits.

(c) How would you distinguish between the following pairs of substances on the basis of tests given in brackets ?
(i) Magnesium (Action of hot water and steam)
(ii) Zinc hydroxide (Action of bases and acids)
(iii) Unknown substance (Action of dilute sulphuric acid)
Answer:
(i) Magnesium reacts slowly with boiling water and forms a base, magnesium hydroxide liberating hydrogen.
Mg + 2H2O → Mg(OH)2 + H
Magnesium bums in steam with an intense white light, liberating hydrogen gas and white ash i.e., magnesium oxide.
Mg + H2O → MgO + H

(ii) Hydroxides of zinc are amphoteric i.e., they react with both bases and acids to give salt and water.
ZnO + 2HCl → ZnCl2 + H2O
ZnO + 2NaOH → Na2ZnO2 + H2O

(iii) When dilute sulphuric acid is added to the given unknown substance and then is warmed a colourless gas is evolved with brisk effervescence, and the gas on passing through lime water turns it milky.
Na2COs + H2SO4 → Na2SO4 + H2O + CO2

ICSE Class 9 Chemistry Sample Question Paper 9 with Answers

Question 6.
(a) State whether the property increases, decreases or remains same in the following cases :
(i) Alkali metals reactivity when one moves down the group.
(ii) Atomic size of elements when one moves down a group.
(iii) Metallic character when one moves down a group.
Answer:
(a) (i) Alkali metals are all very reactive and degree of reactivity increases down the group.
Li < Na < K < Rb < Cs
ICSE Class 9 Chemistry Sample Question Paper 9 with Answers 9

(ii) Size of atoms of successive element increases down the group.
Li < Na < K < Rb < Cs
Atomic size increases
ICSE Class 9 Chemistry Sample Question Paper 9 with Answers 10
(iii) Metallic character increases as one moves down the group. For example : In group 15, nitrogen and phosphorus are non-metals, arsenic and antimony are metalloids and bismuth is a typical metal.

(b) (i) What is the difference between soft water and hard water ?
(ii) Write three physical properties of water.
Answer:
(i)

Soft water Hard water
1. It readily forms lather with soap.
2. It contains high amount of sodium.
3. It is not harsh on skin.
1. It does not readily forms lather with soap.
2. It contains high amount of calcium and magnesium.
3. It is harsh on skin

Physical properties of water are :
1. Nature : Pure water is a clear, transparent liquid. It is colourless, odourless and tasteless.
2. Boiling point: Under normal pressure, pure water boils at 100°C. The boiling point of water is affected by pressure, the greater the pressure the higher the boiling point.
3. Freezing point : Pure water freezes at 0°C under pressure. The freezing decreases with increase in temperature.

(c) Write two types of chemical reactions with two examples of each.
Answer:
Two types of chemical reaction are as follows :

1. Direct combination reactions : A reaction in which two or more substances combine to form a single substance is called a combination reaction.
Example 1.
C + O2 → CO2 + Heat.
Carbon bums in oxygen to form a gaseous compound carbon dioxide.
Example 2.
Fe + S → FeS
The reaction between iron and sulphur to form iron (II) sulphide.

ICSE Class 9 Chemistry Sample Question Paper 9 with Answers

2. Displacement reactions : A reaction in which more reactive element displaces a less reactive element which result in the formation of its salt solution.
Example 1.
CuSO4 + Zn → ZnSO4 + Cu

When zinc is added to copper sulphate solution the displacement reaction takes place and blue colour of the solution fades and becomes colourless.
Example 2.
2KI + Cl2  → 2KCl + H2

When chlorine gas is passed through a solution of potassium iodide the colourless solution turns yellow brown as iodine appears.

Question 7.
(i) Complete the following table :

Element Atomic Mass no. P n e
A 1 1 1
B 14 17 7
C 12 12 12
D 35 17 17

(ii) Give the electronic configuration of A, B, C and D.
(iii) Identify A, B, C and D.
(iv) How many valence electrons are present in A, B, C and D ?
(v) What is the valency of A, B, C and D ?
Answer:
(ii) Electronic configuration of A = 1 Electronic configuration of B = 2, 5 Electronic configuration of C = 2, 8, 2 Electronic configuration of D = 2, 8, 7
(iii) A = Hydrogen, B = Nitrogen, C = Magnesium, D = Chlorine
(iv) A = l, B = 5, C = 2, D = 7
(v) A = l, B = 3, C = 2, D = 1

(b) Write the electronic configuration of the following :
(i) Iron (Fe)
(ii) Palladium (Pd)
Answer:
(i) Electronic configuration of iron is :
Is2 2s2 If 3s2 3f 3d6 4s2
(ii) Electronic configuration of palladium is :
Is2 2s2 2 f 3s2 3p6 3d10 4s2 4 f 4d10

ICSE Class 9 Chemistry Sample Question Paper 9 with Answers

(c) State the valency of the element having :
(i) 5 electrons in the valence shell.
(ii) Electronic configuration 2, 5.
Answer:
(i) The valency of an element having 5 electrons in the valence shell is 3.
(ii) The valency of an element having 2, 5 electronic configuration is 3.
The valency of an element having 2, 5 electronic configuration is 3 and having 2, 3 electronic configuration is also 3.

ICSE Class 9 Chemistry Question Papers with Answers