Code is copied!
CLASS 10 ICSE JAVA COMPUTER APPLICATIONS SAMPLE PAPER 2024 - 1
Maximum Marks:100
Time allowed: Two hours
Answers to this Paper must be written on the paper provided separately.
You will not be allowed to write during the first 15 minutes.
This time is to be spent in reading the question paper.
The time given at the head of this Paper is the time allowed for writing the answers.
This Paper is divided into two Sections.
Attempt all questions from Section A and any four questions from Section B.
Answers to this Paper must be written on the paper provided separately.
The intended marks for questions or parts of questions are given in brackets[] .
SECTION A
(Attempt all questions from this Section.)
Question 1
(i)
Which of the following operators can operate on a boolean variable?
A. && B. == C. ?: D. +=
a) C & B
b) A & D
c) A, B & D
d) A, B & C
(ii)
When does Overloading not occur?
a. When more than a single method have the same name, yet different types or number of
parameters and different method signature
b. When more than a single method have the same name, the same signature, but have different
numbers of signature
c. When more than a single method have the same signature, same name, and the same number of
parameters have different types
d. When more than a single method have the same name, the same number and types of
parameters, and yet different signatures
(iii)
Out of these methods of the String class, which one can be used for testing the strings for
equality?
a. isequals()
b. isequal()
c. equals()
d. equal()
(iv)
What value is returned by the compareTo() function in case the invoking string happens to be
greater than the compared string?
a. a value that is greater than zero
b. a value that is less than zero
c. zero
d. none of the above
(v)
Which of the following methods belong to the String class?
(a) length()
(b) substring()
(c) compareTo()
(d) all of the them
(vi)
A bundle of similar classes is called a
(a) Package
(b) Packed classes
(c) Group
(d) None
(vii)
Akash wants the members of his class Employee to be accessible only to his class “Employee”,
what access specifier he should use for the members
(a) Private
(b) Protected
(c) Public
(d) default
(viii)
The statement to create an object of class student in Java is :
(a) obj= create Object();
(b) obj=new student();
(c) obj=new Student();
(d) None of the above
(ix)
The keyword to create a class is
(a) Class
(b) CLASS
(c) class
(d) None
(x)
What will the output of the following program ?
public class Test {
public static void main (string [ ] args) {
int count = 1
while (count <= 15) {
System.out.println(count % 2 == 1? “***” : “+++++” );
++ count; } } }
(a) 15 times ***
(b) 8 times *** and 7 times +++++
(c) 15 times +++++
(d) Both will print only once
(xi)
The members of a class are defined inside
(a) ()
(b) {}
(c) []
(d) None of the above
(xii)
……………… objects of a class can be created
(a) 5
(b) Only 1
(c) As many
(d) 2
(xiii)
The concept of Abstraction is
(a) Binding data and functions together
(b) Hiding inner complexity and providing usable interfaces
(c) Reusing of the code
(d) Making methods constant
(xiv)
“One thing in many different forms” refers to which oops concept
(a) Polymorphism
(b) Abstraction
(c) Encapsulation
(d) None of above
(xv)
What Will be the output for:
System.out.print(Character.
toLowerCase('P'));
(a) p
(b) P
(c) false
(d) true
(xvi)
Name the package that contains wrapper classes:
(a) java.lang
(b) java.util
(c) java.io
(d) java.awt
(xvii)
Corresponding wrapper class of int data type is __________.
(a) integer
(b) INTEGER
(c) Int
(d) Integer
(xviii)
State the value of y after the following is executed:
char x='7';
y= Character.isLetter(x);
(a) false
(b) 7
(c) true
(d) ‘7’
(xix)
Assertion (A) : In Java more than one method can be created with the same name.
Reason (R) : Java implements polymorphism that allows method to be overloaded
(a) Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation of Assertion
(A)
(b) Both Assertion (A) and Reason (R) are true and Reason (R) is not a correct explanation of
Assertion(A)
(c) Assertion (A) is true and Reason (R) is false
(d) Assertion (A) is false and Reason (R) is true
(xx)
Assertion (A) : A class is an object factory
Reason (R) : Objects are created from class which contains common attribute and behaviour
(a) Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation of Assertion
(A)
(b) Both Assertion (A) and Reason (R) are true and Reason (R) is not a correct explanation of
Assertion(A)
(c) Assertion (A) is true and Reason (R) is false
(d) Assertion (A) is false and Reason (R) is true
(i)
Name the operators listed below :
(i) <
(ii) ++
(iii) &&
(iv) ?:
(ii) Write the prototype of the function 'divide' that takes two integer values and returns the quotient of double type.
(iii)
Total Size of array having 25 elements of char type.
(iv) Name two jump statements in java
(v)
Declare a 2D of size 2x3 to store only characters.
(vi)
What is the output of following :
char c = ‘A’;
short m = 26;
int n = m+c;
System.out.println(n);
(vii)
Convert the do-while loop into for loop :
int i =1;
int d = 5;
do {
d=d*2;
System.out.println(d);
i++;
} while(i<=5)
(viii)
Find the error in following code and correct it
class test {
public static main();{
int a = 10;
system.out.print line("value a is" a);
} }
(ix) Write the Java expression for √(2𝑎𝑠 + 𝑢2)
(x)
What will be the value of y after evaluation the given expression :
y + = ++y + y-- + --y ; when int y =8;
SECTION B
(Answer any four questions from this Section.)
The answers in this section should consist of the programs in either BlueJ environment or any
program environment with java as the base.
Each program should be written using variable description / mnemonic codes so that the logic of the
program is clearly depicted.
Flowcharts and algorithms are not required.
The answers in this section should consist of the programs in either BlueJ environment or any program environment with java as the base.
Each program should be written using variable description / mnemonic codes so that the logic of the program is clearly depicted.
Flowcharts and algorithms are not required.
Question 3
Define a class called with the following specifications:
Class name: Item
Member variables:
String name: name of the item purchased
double price: Price of the item purchased
Member methods:
void accept(): Accept the name and the price of the item using the methods of Scanner class.
void calculate(): To calculate the net amount to be paid by a customer, based on the following criteria:
Price Discount
10000 – 35000 5.0%
35001 – 67000 7.5 %
67001 – 100000 10.0%
More than 100000 15.0 %
void display(): To display the name of the item and the net amount to be paid.
Write the main method to create an object and call the above methods
Question 4