0% found this document useful (0 votes)
15 views

Prep2 QP

The document is an examination paper for Grade 10 Computer Applications at Daffodils English School, Bengaluru. It consists of two sections: Section A requires students to answer all questions, while Section B allows them to choose four questions to answer. The exam includes multiple-choice questions, coding exercises, and programming tasks related to Java.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views

Prep2 QP

The document is an examination paper for Grade 10 Computer Applications at Daffodils English School, Bengaluru. It consists of two sections: Section A requires students to answer all questions, while Section B allows them to choose four questions to answer. The exam includes multiple-choice questions, coding exercises, and programming tasks related to Java.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Daffodils English School

Sanjaynagar, Bengaluru
PREPARATORY EXAMINATION 2
Subject: COMPUTER APPLICATIONS
Grade: 10 Duration: 2 hrs

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.
The intended marks for questions or parts of questions are given in brackets [ ].

Section A
(Attempt all questions from this Section.)

Question 1 [20]
Choose the correct answers to the questions from the given options.
(Do not copy the questions, write the correct answers only.)
(i) Which array is represented in the following picture?

(1) An one-dimensional array with 30 elements


(2) A two-dimensional array with 6 rows and 5 columns
(3) A two-dimensional array with 5 rows and 6 columns

(a) Only (1)


(b) Only (2)
(c) Only (3)
(d) Both (2) and (3)

(ii) The access modifier that gives least accessibility is

(a) public
(b) protected
(c) private
(d) package

January 2025 Page 1


(iii) The size of 9448654825L is

(a) 8 bytes
(b) 10 bytes
(c) 11 bytes
(d) 20 bytes

(iv) Operators with higher precedence are evaluated before operators with relatively lower precedence.
Choose the correct order to arrange the operators given below in the order of higher precedence to lower
precedence:
(1) &&
(2) %
(3) >=
(4) ++

(a) (1) (3) (2) (4)


(b) (2) (4) (1) (3)
(c) (3) (1) (4) (2)
(d) (4) (2) (3) (1)

(v) Which of the following is not a valid Java keyword?

(a) public
(b) package
(c) default
(d) subclass

(vi) The output of Math.round(6.6) + Math.ceil(3.4) is

(a) 9.0
(b) 10.0
(c) 11.0
(d) 11

(vii) Which of the following is not true with regards to a switch statement.

(a) checks for an equality between a variable/an expression and the case labels
(b) supports floating-point literals/constants as case labels.
(c) break is used to exit from the switch block.
(d) case labels are unique

(viii) To execute a loop 10 times, which of the following is correct?

(a) for(int i=11 ; i<=30 ; i+=2)


(b) for(int i=11 ; i<=30 ; i+=3)
(c) for(int i=11 ; i<20 ; i++)
(d) for(int i=11 ; i<=21 ; i++)

(ix) Method prototype for the method round( ) which accept a double argument and returns an integer.

(a) int round(int n)


(b) long round(int n1, int n2)
(c) int round(double n1, double n2)
(d) long round(double n)
January 2025 Page 2
(x) The keyword that terminates the called method is

(a) break
(b) continue
(c) return
(d) exit

(xi) Assertion: Integer class can be used in the program without importing a package.
Reason: It belongs to the default package java.lang.

(a) Both Assertion and Reason are true and Reason is a correct explanation of Assertion.
(b) Both Assertion and Reason are true and Reason is not a correct explanation of Assertion.
(c) Assertion is true and Reason is false.
(d) Assertion is false and Reason is true.

(xii) A student executes the following code, which is incorrect to increase the value of a variable ‘num’ by 1.
num =+ 1;
What should be the correct statement(s)?
(1) num++;
(2) num += 1;
(3) num = num + 1;
(4) ++num;

(a) Only 2
(b) 1 and 4
(c) 2 and 3
(d) All the four

(xiii) Conversion of a wrapper class object to its corresponding primitive type is known as

(a) autoboxing
(b) unboxing
(c) implicit conversion
(d) explicit conversion

(xiv) The String method, which results only in a positive integer is

(a) indexOf( )
(b) lastIndexOf( )
(c) compareTo( )
(d) length( )

(xv) Which principle of Object Oriented Programming does method overloading follow?

(a) Abstraction
(b) Encapsulation
(c) Polymorphism
(d) Inheritance

January 2025 Page 3


(xvi) The logical operator, which is a unary operator is

(a) &&
(b) ||
(c) !
(d) ++

(xvii) The equivalent statement for the following if statement is…


if(n1 > n2)
m = n1;
else
m = n2;
(1) m = Math.max(n1, n2);
(2) m = (n1 > n2) ? n1 : n2;
(3) m = (n1 < n2) ? n2 : n1;

(a) Only 1
(b) Both 1 and 2
(c) Both 2 and 3
(d) All of them

(xviii) Multiple branching statement in Java is

(a) for
(b) while
(c) do…while
(d) switch

(xix) The do…while loop is an

(a) entry-controlled loop


(b) infinite loop
(c) exit-controlled loop
(d) empty loop

(xx) Name the type of error that occurs for the following statement:
System.out.println(Math.sqrt(25 – 50));

(a) Syntax error


(b) Logical error
(c) Run-time error
(d) No error

Question 2 [20]
(i) Rewrite the following code using simple if statement:
if(students.equals(“mine”))
System.out.println(“BEST”);
else if(students.equals(“MINE”))
System.out.println(“BEST”);

January 2025 Page 4


(ii) Evaluate the given expression when the value of a = 2 and b = 3.
b += a++ – ++b * ++a;
System.out.println(“a = ” + a);
System.out.println(“b = ” + b);

(iii) Write the Java expression for | x10 + 2xy |

(iv) How many times will the following loop executes? Write the output of the code.
int x = 10;
while(true)
{
System.out.println(x++ * 2);
if(x%3 == 0)
Break;
}

(v) Write the output of the following:


String s1 = “BEST”, s2 = “REST”;
(a) System.out.println(s1.charAt(0) == s2.charAt(s2.length( ) – 1));
(b) System.out.println(s1.compareTo(s2));

(vi) Name the following:


(a) Method with the same name as of the class and is used to initialise the data members.
(b) The access specifier that gives access to all classes in the same package and any sub classes that
are in other packages.

(vii) The output of a which extracts a part of the string “SITHARAMAN” is as follows:
(a) “RAM”
(b) “RAMAN”
Write appropriate Java statements to get the above outputs.

(viii) Arjun has developed a program to display only the alphabets stored in a character array. Below is the
segment of his program, which has some errors. Check for the statements with errors and write the
correct statements.
char ch[ ] = {‘D’, ‘#’, ‘E’, ‘1’, ‘S’};
for(int i=0 ; i<=ch.length( ) ; i++)
if(Character.isAlphabet(ch[i]))
System.out.print(ch[i]);

(ix) Consider the following program segment and answer the questions that follow:
int prime[ ][ ] = { {2, 3, 5, 7} , {11, 13, 17, 19} , {101, 109, 151, 199} };
(a) What is the index of 109?
(b) What is the result of prime[2][3] + prime[0][1]?

January 2025 Page 5


(x) Consider the following program segment which find the sum of elements in left diagonal and the
product of elements in right diagonal:
int arr[ ][ ] = {{1, 2, 3} , {4, 5, 6} , {7, 8, 9}};
int sld = 0, prd = 1;
for(int i=0 ; i<3 ; i++)
a (a) a
for( _ (b) a)
prd = prd * arr[i][j];
System.out.println(“The sum of elements in left diagonal = ”+sld);
System.out.println(“The product of elements in right diagonal = ”+prd);
Fill in the blanks (a) and (b) with appropriate Java statements.

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.
BufferedReader / DataInputStream should not be used in in the programs.

Question 3 [15]
Define a class named BookFair with the following description:

Instance Variables/Data Members:

String bName – stores the name of the book


double mPrice – stores the marked price of the book
double sPrice – stores the selling price of the book

Member methods:

BookFair( ) – To initialize the data members with default values.


void accept( ) – To accept and store the name and the marked price of the book.
void calculate( ) – To calculate the selling price after discount.
Discount is calculated based on the following criteria:
Marked Price Discount
Less than D 1001 5%
D 1001 to D 3000 10%
More than D 3000 15%
void display( ) – To display the details in the following format:
Book Name Marked Price Selling Price
______ ______ ______

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

January 2025 Page 6


Question 4 [15]
Design a class to overload a method method( ) as follows:

(a) void method( ) – To display the following pattern using nested loops.

54321
4321
321
21
1

(b) void method(int num) – To check and display whether the integer num is a prime number or not.
A number is said to be a prime number if it has only two factors (i.e., 1 and the number itself)

Example:
num = 13

Output : It is a Prime Number .

(c) boolean method(String str, char ch) – To check for the character ch in a string str and return true if
found, otherwise return false.

Example:
str = “daffodils”
ch = ‘a’

Return : true

Question 5 [15]
Write a program to accept a word. Convert the word to uppercase. Count and output the number of consecutive
letters and number of double letter sequences that exist in the word.

Sample Input: “UNDERSTOOD”


Sample Output: Number of consecutive letters = 3
Number of double letter sequences = 1

[Note: DE, RS and ST are consecutive letters, and OO is a double letter sequence in the word UNDERSTOOD]

Question 6 [15]
Write a program to accept a number from the user and check whether it is a DISARIUM number or not

Note: A number will be called DISARIUM, if sum of its digits powered with their respective position is equal
to the original number.

Example: 135 is a DISARIUM (Working: 11 + 32 + 53 = 135)


Some other DISARIUM numbers are 89, 175, 518 etc.

January 2025 Page 7


Question 7 [15]
Write a program to initialize the members of our Student Council along with their post in the Student Council
in two different arrays. Search for a name of the student input by the user. If found, display the name of the
student along with his/her post in the Student Council, otherwise display “Sorry Not Found”.

Members – Amartya Prabhu, Aadhya Uday, Lipyashree N., Sampriti Chaudhury, Deepak V.,
Bhumika J., Aditi Yaragunti

Posts – Head Boy, Head Girl, Sports Captain, CCA Captain, Band Captain, Iris House Captain,
Tulip House Captain

Example – Input: Lipyashree N. Output: Lipyashree N. – Sports Captain


Input: Murthy Output: Sorry Not Found

Question 8 [15]
Write a program to input and store the height of your classmates. Sort and display them in descending order
using the selection sort technique.

===========================

January 2025 Page 8

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy