0% found this document useful (0 votes)
67 views4 pages

12-RE4-C10-COMQP

ICSE CLASS 10 COMPUTER QUESTION PAPER
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
67 views4 pages

12-RE4-C10-COMQP

ICSE CLASS 10 COMPUTER QUESTION PAPER
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 4

Subject: Computer Application Name:

Marks: 100 Revision Exam No. 4 Grade: Class 10


Time: 2 hours Date:28.12.24

You will not be allowed to write during the first 15 minutes.


This time is to be spent in reading the question paper.
The time given at the head of this Paper is the time allowed for writing the answers.
This Paper is divided into two Sections.
Attempt all questions from Section A and any four questions from Section B.
The intended marks for questions or parts of questions are given in brackets [].
SECTION A (40 Marks)
(Attempt all questions from this Section.)
Question 1
Choose the correct answers to the questions from the given options. [20]

(i) Which feature of Object oriented is represented by following image?


Mom: "Son, I am the base class"
Son: "Mom, I am the derived class"
(a). Abstraction (b) Polymorphism (c) Encapsulation (d) Inheritance
(ii) What is byte code in Java?
(a) High-level code written by programmers (b) Machine code executed by the CPU
(c) Intermediate code generated by the Java compiler (d) Low-level code written in Assembly language

(iii) Which data type is greater than byte and less than int in size?
(a) double (b) char (c)float (d) boolean

(iv) Which of the following is a unary operator?


(a) + (b)++ (c) / (d) ?

(v) Which is not suitable for java?


(a) Platform Independent (b) Object Oriented (c) High level language (d) Machine level language
(vi) Which of the following is a valid way to create a multiline comment in Java?
(a) // This is a multiline comment (b) /* This is a multiline comment */
(c) /* This is a multiple comment // (d) \*This is a multiline comment *\
(vii) Which of the following Math class methods returns a random floating-point number between 0.0(inclusive)
and 1.0 (exclusive)?
(a) Math.abs() (b) Math.round() (c) Math.ceil() (d) Math.random()
(viii) Assertion: In object-oriented programming, a class can be considered as an object factory.
Reason: A class defines the blueprint for creating objects, and objects are instances of classes. When
you create an object from a class, you are essentially using the class as a factory to produce instances
of that class.
(a) Both the Assertion and Reason are correct, and Reason is the correct explanation of
Assertion
(b) Both the Assertion and Reason are correct, but Reason is not the correct explanation of
Assertion.
(c) Assertion is true and Reason is false
(d) Assertion is false and Reason is true
(ix) What will be the output of following snippet?
int i;
for(i = 5; i >= 1; i--)
{
if(i % 2 = 1)
continue;
System.out.print(i + " ");
}
(a) 4 2 (b) 5 3 (c)5 2 (d) 1 4
(x) What will be stored in value if,
int num1 = 10, num2 =12;
value = (num1*2>=num2*2) ? num1++ : num2++;
(a) 10 (b) 12 (c) 11 (d) 13
(xi) Which data types are used to accept the character in Java programs?
(a) float (b) int (c)String (d) char
(xii) Identify the output of the following:
System.out.println(Math.round(-18.5));
(a) -18 (b) 18.0 (c) 18 (d) -18.0
(xiii) Which of these keywords is used to define packages in Java?
(a) pkg (b) Pkg (c) Package (d) Package
(xiv) The Math class in Java belongs to which of the following package?
(a) java.lang (b) iava.io (c) java.util (d) iava.Scanner`
(xv) The Scanner class in Java belongs to which of the following package?
(a) java.lang (b) java.io (c) java. Util (d) java.us
(xvi ) Consider the following if-else statement:
if(num > 0)
System.out.println("Positive Number");
else
System.out.println("Negative Number"):
The corresponding ternary operator for the same is:
(a) System.out.println( (num > 0) ? "Positive Number"; "Negative Number");
(b) System.out.println((num > 0)? "Positive Number": "Negative Number");
(c) System.out.println((num > 0)? Positive Number: Negative Number);
(d) System.out.println((num > 0) : "Positive Number" ? "Negative Number");
(xvii) The number of bytes occupied by a double data type in Java:
(a) 4 bytes (b) 2 bytes (c) 8 bytes (d) 16 bytes
(xviii) What will the following statements print?
char c='a';
int d = c;
System.out.println((char)d);
(a) c (b) 65 (с) a (d) 97
(xix) Code Reusability is implemented by:
(a) abstraction (b) Inheritance (c) Polymorphism (d) overloading
(xx) A function name can begin with:
(a) Special Characters (b) Space (c) Digit (d) Underscore

Question 2
(i) Name the keyword that: [2]
(a) skips the current iteration but goes for the next iteration
(b) terminates the loop
(ii) What's the final answer stored in z in the following? [2]
z=Math.floor(Math.abs(-23.8));(2)
(iii) Write the Java expression for the following: [2]
(a) X+Y/(XY)²
(b) √x¹⁰+√mnc +|log x|
(iv) Create an object namely lily for the class Flower [2]
(v) Convert the following into while loop and also find the output [2]
for (x=6, y=3: x<=10;x+=2)
System.out.println(x+2*y);
System.out.println(x++);
(vi) Find the output for the following [2]
for(i=5;i<=8;i++)
for(j=1;j<=3;j++)
System.out.println(j);
System.out.println(i);
(vii) How many times the following loop gets executed? Find the output also. [2]
int a=6;
while(a++<=10)
{
System.out.println(++a);
System. out.println (a++);
}
System.out.println(++a);
(viii) Give TWO differences each between [2]
(a) Functions and constructors
(b) Pure and impure functions
(ix) Give the function prototype for a function namely add () that accepts 3 numbers and returns a boolean value.
What is its function signature [2]
(x) Convert the following into if else statement: [2]
ans= (x>y)?(x>15? Math.ceil(x):Math.floor(y)):Math.random();
Find the output also if x is 2 and y is 3

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]

Question 3 [15]
Write a menu driven class to accept a number from the user and check whether it is a Pronic number or an
abundant number:
(a) Pronic number— eg: 6 (2x3=6), 20(4x5=20)
Multiplying the successive numbers result the input number
(b) Abundant number— (a number is called abundant if it is greater than greater the sum of its factors other
than the number itself)
Example: 18 is an abundant number. Its factors are 1+2+3+6+9 = 21 which is greater than 18.

Question 4 [15]
Define a class named Bank with the following description:
Instance variables/data members:
int P — To store the Principal
double T — To store the number of years
double R— To store the rate of interest
double SI - to calculate the simple interest
int age - to accept the age of the person.
Member methods:
void input( ) — To input and store the Principal and number of years
void calculate( ) — To compute the simple interest based on the rate of interest given below
No of years Interest
1 to 2 7%
Above 2. 8%

Include 0.5% for the senior citizens (age 60 and above)


void display ( ) — To display the detail
Write a main method to create an object of the class and call the above methods.

Question 5 [15]
Using function overloading:
(i) void calculate(int) - checks whether the number is a spy number or not
Eg: 123 is a spy number
Reason: 1+2+3 =6 and 1x2x3=6
(ii) String calculate (int a, int b) - checks whether any prime number is between a and b including these two
numbers.
Eg: a=6, b=10 then it should return the message, "Yes, there is a prime number"
a=8, b=10. It should return, "There is no prime number"

Question 6 [15]
Write a program to calculate the value of z for the following:
z = 2y/4! + 4y/6! + 6y/8! + .....ny/(n+2)!
Data members
int - y and n
double - z
Member Methods
Summation () - a default constructor
input() - accepts the value for y and n using scanner class
calc() - calculates the answer for z
display () - prints z
main() - call the above functions using object
Question 7 [15]
Write a program using function overloading to print the following patterns:
(a) void pattern (int) to do the following pattern by accepting the number of rows.
Example: if n= 5. (5 rows) then
1
12
123
1234
12345
(b) void pattern ( String) - accepts a string and prints and pattern as follows
Example: if the string is Lion, then it has to print as follows
L
LI
LIO
LION
Question 8 [15]
Write a program to accept two numbers a and b and print the:
(i) prime numbers between them.
(ii) print the tables between them

You might also like