Oswal 61 Sample Question 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 + 8 % 2
⇒ 4 + 0
⇒ 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.

(vii) (a) a compound statement

 Explanation :

If multiple statements execute for a condition it is a compound statement.

(viii) (b) 0 times

 Explanation :

The loop condition i>100 will never meet as i is getting decremented.

(ix) (d) All of these

 Explanation :

A nested while loop can have any of the types of blocks if/for/switch etc.

(x) (a) Stealing jewellery

 Explanation :

Stealing jewellery is not related to crime using network and electronic media.

(xi) (a) Instructions only

 Explanation :

As Procedure Oriented Programming follows Top-down approach so the focus is on the steps or instructions to solve a problem.

(xii) (a) Objects

 Explanation :

The objects of a class are the ones who can access and invoke the functions of the class.

(xiii) (a) Keyword

 Explanation :

While is a keyword in java that is used to create loops.

(xiv) (c) Ternary

 Explanation :

The Ternary operator ?: takes more than two operands . It is also called as conditional operator.

(xv) (c) Abstract Window Toolkit

 Explanation :

AWT stands for Abstract Window Toolkit, it is used by applets to interact with the user.

(xvi) (b) 98.0

 Explanation :

The Math.floor( ) function returns the lower whole number value of a fractional number.

(xvii) (b) Scalene triangle

 Explanation :

Since the conditions imply all the three sides are unequal , the output must be scalene triangle.

(xviii) (a) Never

 Explanation :

The loop will not execute as the value of i starts with 10 and the loop condition is i<10, which is never met.

(xix) (d) All iterations of outer loop

 Explanation :

The inner loop iterates for all iterations of the outer loop.

(xx) (d) All of these

 Explanation :

A FOSS is a software that can be freely used , copied and modified.

Answer 2.

  • (i) double pr = ( b != q ) ? 100 : 250;
  • (ii) Object Oriented Programming (OOP) is a programming paradigm which revolves around the behaviour of an object, and its interactions with other objects and
  • classes. In OOP, the program is organised around data or objects rather than functions or procedures. It follows the design principles of Data Abstraction,
  • Encapsulation, Inheritance, and Polymorphism.

(iii)

Attributes Behaviours
Manufacturer Start Computer
Model Shutdown Computer
Processor Run Applications
RAM
Hard Disk

(iv) (a) i + c/b;
int + char / byte
⇒ int + char
⇒ int

(b) f/d + c*f;
⇒ float / double + char * float
⇒ double + float
⇒ double

(v) p = ++a + –a
⇒ p = 8 + 7
⇒ p = 15
q – = p
⇒ q = 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() Math.abs()
1. Used to round a decimal fraction as per the rounding rules. 1. Used to find the absolute value of a number.
2. Example Math.round(121.75), returns 122 2. Example Math.abs(– 121.75) returns 121.75

(viii) if (c= =1 || c= =2)
x++;
else if (c= =3 || c= =4)
y++;
else
n++;

(ix) Below is the syntax of nested for loop:
for (<initial value>; <test condition>; <update value>)
{
for (<initial value>; <test condition>; <update value>)
{
executable statement(s)
}
}

(x) When we purchase an original software, we become the licensed user and we get the right to use it. However, we cannot make copies of this software and load it in other computers. Thus, when someone copies a software without buying the appropriate license or copyright, it is known as software piracy. Piracy can come in many forms:
1. Licensed user duplication for unlicensed users.
2. Illegal internet distribution.

Section-B

Answer 3.

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 Q3
{
void main()
{
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.nextInt();
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 );
}
}

Variable Description Table

Variable Name Data Type Use
M, N double Input variable
W double result

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
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 61 Sample Question Papers

All Subjects Combined for Class 9 Exam 2024

The dot mark field are mandatory, So please fill them in carefully
To download the Sample Paper (PDF File), Please fill & submit the form below.