ICSE Class 9 Computer Applications Sample Question Papers
ICSE Class 9 Computer Applications Sample Question Papers
9
Compute
r
Applicati
ons
Sample
Question
Paper 1
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
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]
Question 2.
Answer with respect to given code.
[5 x 2 = 10]
(a) What will be the value of b, c
when n1 = 10, n2 = 0, given that:
[2]
int b = (n1 < n2) ? n1 : n2 ;
double c = (n2 != 0) ? (n1/n2) : (n1 *
2);
(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.
(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.
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
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]
Question 6.
Write a program to print the given
series : [15]
3 6 12 24 48 96 …. up to n terms
Output
Enter the number of terms : 7 6 12
24 48 96 192 384s
Question 7.
Write a program to input n and print
the following pattern [ here n = 4]
[15]
@ @ @ @
@ @ @
@ @
@
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.
Time Taken in seconds: 5000
The time taken is 83 minutes and 20
seconds
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]
ICSE Class
9
Compute
r
Applicati
ons
Sample
Question
Paper 2
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 ?
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?
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];
}
(b) Identify the error, if any, in the
following code snippet:
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 )
(d) What are the components of a
for loop ?
(e) What is the role of break
statement in a loop ? Show a code
example.
(f) Write the output of the following
code :
int y = 6;
do
{
System.out.print( y++ + ” .. ” )
y++;
}
while ( y <= 12);
(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 + ” “);
}
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
Question 5.
Input two numbers and find the max
and min. Show the use of the
ternary operator.
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.
Question 7.
Print the given series using a for
loop.
10 2 30
4 50 6 … upto n
terms
Output :
Enter number of terms : 10
10 2 30 4 50 6 70 8 90 10
Question 8.
Input a number of type integer.
Calculate and print the product of its
digits. Use while loop.
Question 9.
Print the following pattern using
nested for loop.
5
6 5
7 6 5
8 7 6 5
9 8 7 6 5
ICSE Class
9
Compute
r
Applicati
ons
Sample
Question
Paper 3
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.
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;
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);
Question 9.
Print the following pattern using
nested for loop :
ICSE Class
9
Compute
r
Applicati
ons
Sample
Question
Paper 4
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?
Question 2.
(a) What is fall through?
(b) What are the various loop
statements used in Java?
(c) Write the uses of break
statement.
(d) What is netiquette? State two of
them.
(e) Write two protective measures
to safeguard your computer.
Question 3.
(a) What are keywords? Give
example.
(b) Name two rules of naming an
identifier.
(c) What are literals? Give example.
(d) What is type casting?
(e) What is special about the 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.
(g) Rewrite the following using
if ..else construct switch ( ko )
case 25 : System.out.print
(“Yellow”);
break;
default: System.out.print (“Purple”);
(h) Rewrite the following using while
loop
for ( m = 75; m >= 50 ; m = m - 10)
System.out.print( k + " " );
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.
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.
Output
Enter number of days late : 12
Number of days late 12
Fine to pay = ₹ 30
Question 6.
In an art workshop, different courses
had different course code and
course charge per day, as given
below
Course Code Course Name Course Charge
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]
Output Enter the Course Code : 102
Enter the number of days of course :
15
Amount to pay = ₹ 1875.
Oswal 61 Sample
Request Papers
ICSE Class 9
Computer
Applications
Solutions
Section-A
Answer 1.
(i) (b) encapsulation
Explanation :
Encapsulation is the process of
binding together data and methods
of objects / entities as one unit.
(ii) (b) An object
Explanation :
An object is an identifiable entity
with a set of attributes, behaviour
and state.
(iii) (a) 4 bytes
Explanation :
The float data type in java is of 4
bytes.
(iv) (c) 4
Explanation :
⇒4+0
4+8%2
⇒4
Due to operator precedence 8 % 2 is
evaluated first. Its result is 0 so final
result is 4.
(v) (c) Comment
Explanation :
/* … */ are used in Java to write
multiline comments.
(vi) (c) pow( )
Explanation :
The pow() function returns the value
of a number raised to an exponent.
RAM
Hard Disk
⇒ int + char
int + char / byte
⇒ int
⇒ float / double + char * float
(b) f/d + c*f;
⇒ double + float
⇒ double
⇒p=8+7
(v) p = ++a + –a
⇒ p = 15
⇒q=q–p
q–=p
⇒ q = 0 – 15
⇒ q = –15
(vi) Scanner sc=new
Scanner(System.in);
String n=sc.nextLine( );
String sn= sc.nextLine( );
String add= sc.nextLine( );
System.out.println(n+ “\t” + sn);
System.out.println(“\t”+add);
(vii)
Math.round() Mat
1. U
1. Used to round a decimal fraction as
abs
per the rounding rules.
num
2. Example Math.round(121.75), 2. E
returns 122 121
M, N double
W double
Answer 4.
import java.util.*;
public class arithmatic
{
public static void main(String [] args)
{
int a,b,sum=0,sub=0,mul=0 ,mod=0;
double div=0.0;
Scanner sc=new Scanner(System.in);
System.out.println(“Enter 1st
number :”);
a=sc.nextInt();
System.out.println(“Enter 2nd
number :”);
b=sc.nextInt();
sum=a+b;
sub=a-b;
mul=a*b;
div=a/b;
mod=a%b;
System.out.println(“Sum :” + sum);
System.out.println(“Substraction :”
+ sub);
System.out.println(“Multiplication :”
+ mul);
System.out.println(“Division :” +
div);
System.out.println(“Modulus :” +
mod);
}
}
Answer 5.
import java.util.Scanner;
public class ProgBuzzAutomorphic
{
public static void main(String args[])
{
Scanner in = new
Scanner(System.in);
System.out.println(“1. Buzz
number”);
System.out.println(“2. Automorphic
number”);
System.out.print(“Enter your choice:
“);
int choice = in.nextInt();
System.out.print(“Enter number: “);
int num = in.nextInt();
switch (choice)
{
case 1:
if (num % 10 = = 7 || num % 7 = = 0)
System.out.println(num + “ is a Buzz
Number”);
else
System.out.println(num + “ is not a
Buzz Number”);
break;
case 2:
int sq = num * num;
int d = 0;
int t = num;
while(t > 0)
{
d++;
t /= 10;
}
int ld = (int)(sq % Math.pow(10, d));
if (ld = = num)
System.out.println(num + “ is
automorphic”);
else
System.out.println(num + “ is not
automorphic”);
break;
default:
System.out.println(“Incorrect
Choice”);
break;
}
}
}
Answer 6.
import java.util.Scanner;
public class ProgSpecialNumber
{
public static void main(String args[])
{
Scanner in = new
Scanner(System.in);
System.out.print(“Enter a 2 digit
number: “);
int orgNum = in.nextInt();
if (orgNum < 10 || orgNum > 99)
{
System.out.println(“Invalid input.
Entered number is not a 2 digit
number”);
System.exit(0);
}
int num = orgNum;
int digit1 = num % 10;
int digit2 = num / 10;
num /= 10;
int digitSum = digit1 + digit2;
int digitProduct = digit1 * digit2;
int grandSum = digitSum +
digitProduct;
if (grandSum = = orgNum)
System.out.println(“Special 2-digit
number”);
else
System.out.println(“Not a special 2-
digit number”);
}
}
(v) (a) There would be no growth of
mould on moist bread as mould could
not grow in lower temperature.
(b) Mycelia first appears on the bread.
(c) Bread mould obtain its nourishment
by extracellular digestion from the
substratum on which it grows. This
nourishment is called saprophytic
mode of nutrition.
Answer 7.
import java.util.Scanner;
public class ProgMultipleHarshad
{
public static void main(String [ ]
args)
{
Scanner in = new
Scanner(System.in);
System.out.print(“Enter number to
check:”);
int num = in.nextInt();
int dividend = num;
int divisor;
int count = 0;
for(dividend>1)
{
divisor=0;
int t = dividend;
for(int t = 1 ; t>0 ; t++)
{
int d = t % 10;
divisor += d;
t /= 10;
}
if (dividend % divisor = = 0 &&
divisor != 1)
{
dividend = dividend / divisor;
count++;
}
else
{
break;
}
}
if (dividend = = 1 && count > 1)
System.out.println(num + “is
Multiple Harshad Number”);
else
System.out.println(num + “is not
Multiple Harshad Number”);
}
}
Answer 8.
import java.util.*;
public class Q8
{
void main()
{
Scanner sc = new Scanner
(System.in);
int C = 0, D = 0 , T = 0;
System.out.print(“Enter the Course
Code : ”);
C = sc.nextInt();
System.out.print(“Enter the number
of days of course : ”);
D = sc.nextInt();
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 =
` ” + T );
}
}
Variable Description Table
Variable Name Data Type Use