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

ACB_mock_comp 03-Dec-2024

Uploaded by

Revlo Ghosh
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)
13 views

ACB_mock_comp 03-Dec-2024

Uploaded by

Revlo Ghosh
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/ 4

AUXILIUM CONVENT SCHOOL, BANDEL

CLASS X MOCK EXAMINATION (2024-25)


SUBJECT: COMPUTER APPLICATIONS
Maximum Marks: 100
Time alloved: Two hours
Answers to thispaper must be written on the paper provided separately.
You will not be allowed to write during the ftrst 15 minutes.
The time given This time is to be spent in reading the question paper.
at the head of
this paper the time allowed for writingthe answers.

Attempt all questions1hisfrom


paper is divided into two Sections
Section Aand any four questions from Section
Theintended marks for B.
questions or parts of questions are given in brackets [].

SECTION-A
Question:1 (Attempt all questions from this section)
Name the type of array represented in the (20]
picture below:

(a)One-dimensional array (b)Two-dimensional array


(c)Three-dimensional array (d)Multi-dimensional array
Which access specifier we cannot use for
(a) static (b) public
constructor?
(c)private (d)protected
" (it)What is the result of x%oy ifx andyare int type
(a) -2
variables having -14 and -13 respectively?
(b) 2 (c) 4 (d) error
(iy The smallest value that byte data type takes is
(a) 0 (b)100 (c ) -128 (d) -127
MRead the below code statement of class named Test' and answer the
static void abc){ question:
int x-3;
int y=x+10; }
Test ob-new Test);
Which is the right way to call method abc in main method?
(a)abc() (b)ob.abc); (c) Static abc); (d)All of the above.
(vi)When we pass an array to a method, the method receives
(a)The length of the array (b)A reference of the array
(c) Acopy of the array (d)All of the above
(inComplete the following code by writing asingle statement so that the method returns the
incremented value of x,if x is equal tO y,otherwIse it retums the decremented value of vy
public class xyz
public int funct(int x, int y)
/*Write here single line code*/

(a)Xx==y)?return ttx:retun --y; (b)(x =y):return ttx:return --y;


(c XX==y)?return + ty:return --x; (d) (x=y)?retun +tx ?retun - y;

(tlfy||F0:
What is the value of y[oj?
(a) 0 (b)No output (c)lndexOutotBoundsException (d)Junk vaiue pTO
Question2

-ind
c

packages,
ix)System and Math classes are contained in
(a) lang (b) oi (c) util (d)api
What is the output of the below code:
int a[]-new int[50]:
for(int i=1;i<=3;it+){
alil=i:;)
System.out.print
(a) 3 (a.length);
(b) 4 (c) 5 (d) 50
( ||
(a)Lowcroperator (b)Higher
has precedence than &&
(c)Equal (d)All of the above
) Which of the
following is valid result of the stalement:
System.out.print("Namaste.comparcTo("NAMASTEY") ;
1, -1
(a)Only 1.
2.0
(b)Only 2
3.greater than 0 value
(c)Only 3 (d)Both 1. and 4.
4.less than 0 value

(XIWhat happens when you cxecute the below code?


int someArrayl]=new int{5};
someArray-new int[10];
(a)rogram gives a runtime errOr as you cannot change che size of an array once declared.
(b)Program gives a syntax error as it has a granmatical error.
(C)Program does not give any error and runs fine by aliocating the size of someArray as 10
(a)Program does not give any error and runs fine by allo¢ating the size of someAray as 5
(sjiWhich of the following willbe the output when below statements are executed
System.out.print("Here is an exenmplary leader".substring(-1);
(a)null (b)spaces (c)r (d)Erro¢Exception
(xriVM is an/a
<(a)lnterpreter (b) Compiler (c)Intermediate code (dHigh level Language

i)Size of aclass with two instance variables of data ty pes double is:
(a)4 bytes (b) 8bytes (c) 16bytes (d)32 bytes

(xyAssertion(A):Character is the wrapper class of char.


Reason(R ):Wrapper classes enable to convert primitive data types to their objects. Char data type can be
converted to Character object.
(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.

(xvi)Read the statement and answer the question:


A
logical operator in Java programming is an operator that returns a true or false that is based on the
Boolean result of one or two other expressions.
Does the logical && operator check the second condition if the first condition is false?
(a) No (b)Yes (c)May be (d)None of the above

(xix)Assertion(A):compareTolgnoreCase() method is similar toequalslgnoreCase) except the return


typeof the former is an integer and of latter it is boolean.
Reason(R):equals() is case sensitive.
(a)Both Assertion (A) and Reason(R) are true and Reson (R) is a correct explanation of Assertion(A).
(b)Both Assertion(A) and Reason R) are true and ReascnR) is notacorrect explanation of Assertion{ A).
(c)Assertion(A) is true and Reason(R) is false.
(d)Assertion (A)is false and Reason(R ) is true.
e) State the output of the belowcode:
class Test{
int a-5; String c="2",
public static void main(){
Test ob =new Test(0:
System.out.print(ob.a + $ " +ob.c);
(b)10 (c)S**2 (d04uli PTO
(a) 25
CL-X /Comply 3
Question 2.

(Yind errors in the following program scgment and write the corect statemente.
private class Number [2
private double w;
private void assignNumber(double 2)
h-2:}
}lend of the class number
public class checkError
{
checkError object=New checkError();
checkError.assignNumber(15.26);
System.out.println(h);
/*End of class checkError*/
(GWhat will be the status of
used for arranging elements infollowing list after third pass of bubble sort and
ascending order? 40,67,-23,11,27,38,-1 third pass of selection sort
(in The following is a segment of a
int x=l:y-1; program: [2)
if(n 0){
X=X+1;
yy-l;
What will be the value of x and y,if n
assumes a value 1(0?
(iConvert the
int m-5,n-10; following While loop to the corresponding for loop: [21
while(n>=1){
System.out.printin(m*n);
n--;}
(State the method that:
Convert a string to a primitive float data type. [2
(Determine if the specified character is an uppercase character.
(vYWhat is the difference between length and length() functions.
[2]
(viConsider the following Java statements and answer the questions that follows:
String a-("FLORIDA","AMAZON","WASHINGTON": [2]
(aWhat is the range of indices for array a?
(b)What is the size of array?
(vii What will be the following code output?
String s="malayalam"; [21
System.out.printin(s.indexOf('m');
System.out.println(s. lastIndexOf('m');
CixWhat is the use of the JAVA keyword "this"?Ilustrate with an examnle
[2]
Showthe output of the following looping constructs:
int que--12; [2
boolean ans-true;
while(ans) {
if(que<0)
quett;
continue:}
else
break;

Sy stem.outprintin(que):
p. TO
SECTION-B
)
cL-x|Conla9
(Answer any four questions from this SectionBlueJJenvironment or any
The answers in this section should consist of the grams in either
progr
environment withiavaas the base
Each program should be Program
written using variable descriptionmnemonic codessoth¡tthe logic of
the program is clearly depicted.
Flowcharts and algorithms are not requirea
Question 3: The calorie exercise can be. The
higher this value, the moreconsumed per minute (CCM) is aunit of how strenuous anactivity is 20 cal/min
- this strenuous the exercise. For example, if the CCM for calories. Hence. if the
mcans that for every minute one
person docs thc exercisc of the exercise, the will have to burn 20
will burnperson
for
football, the CCM value for an15 mins, hc/she a total of 20 * 15 = 300 calories In a game of
athlete varies
For the first 15 mins,the
throughout the 90. mins,based on the intensity ofthe game.
The next 30mins (till thegame is high intensity -ihe
CCM value is 30 caunm
half time of 45mins) - the CCM
After the restart, for the next 30 mins - the value drops to 20
The last 15 mins of the game is high CCM a0ain drops to 15 cal/mim cau
intensity witha cCM value of 35 calmin
WAP to input the amount of time in minutes that the athlere has
less than 90, print an error plaved in the match (this value shoula be
by that athlete during the message not so). Then calculate how much total calories have been expchded
if
match. [15)
Question 4: Designa class to overload a function series() as
display the sum of the series follows:
(3void series(int a, int n)To [15]
a - (a/2!) + (a/3!) - (a/4!) + n terms
given below:
(b void series(int n)-To isplay the sum of
1/2- 2/3+ 3/4 - 4/5 + the series given below:
n terms
Write a main method to create an object and invoke the
above methods.
Question 5:
Write a menu driven program to display the pattern as per user's
Pattern.1 choice. [15)
ABCDE Pattern 2.
B
ABCD
ABC
LI.
UUr
AB EEEE
A
For an incorrect option, an appropriate errOr message should be displayed.
Question 6: A Dudeney number is a positive integer that is a
cqual to the cube root of the number. Write a program to inputperfect cube such that the sum of its digits is
a number and check and print whether it is
a Dudeney number or not.
Example: (15)
Consider the number 512.
Sum of digits = 5 + 1+2=8
Cube root of 512 =8
As Sum of digits = Cube root of Number hence 512 is a Dudeney
number.
Ouestion 7: Write a program in Java to enter a Sring Sentence and display the
length of the longest word present in the String. longest word and the
Sample Input: "TATA FOOTBALL ACADEMY WIl LPLAY [15|
Sample Output: The longest word: FOOTBALL: AGAINST MOHAN BAGAN"
The length of the word: 8
Question 8: Write a program to perfom binary search on a list of integers given
clement input by the user. If it is founddisplay the element along with its position,elow, to search for an
otherw isc display the
message "Search element not found".
5, 7,9, 11, 15, 20, 30,45, 89, 97

You might also like