computer
computer
§
C.N.M.& N.D.PAREICH
CW'lCHOOl
The intended marks for questions or parts ofquestio,ns are given· in· brackets [}.
,"
SECTION - A (40 ~arks]
Attempt all ques~,~s.
Question 1. Choose the correct answers to the questions,.from,:t~e given options. (20]
(i)
Method (x)
Method (x. v)
Method (x, v. z)
--------------------------------- ---------------------------------------------11
Std. X - Computer Applications First Terminal Examination-2024-25 Page 1 of
(iii) The output of the following is:
Character.islowerCase{'r');
Character.isletterOrDigit{'$');
System.out.print(arr[b++]);
(a) VA
(b)A V
(c) JA
(d) N
(d) 32 bytes
.,
int arr(]={2,5,6,7,8,9,10};
wh ile(i<arr.length-3)
{
arr[.H:1]++;
i++;
(a) 168
(b) 689
(c) 189
(d)-968.
help of an object.
(x) A - - - - - method needs to be called with the
(a) public
(b) instance
(c) class
(d) void
Page3 ofll
Std. X - Computer Applications First Terminal Examination-2024-25
(xi) · . is correct for the given if elst
Which one of the following conversion into equivalent ternary
if(nl>n 2)
r=true;
else
r=false;
System.out.print(y);
/
(a) 3.01024.0
(b) 4.01024.0
(c) 3.04096.0
. ,·
(d) 4.04096.0
(xiii) Which java keyword indicates thaftbe function does not return anythi
ng?
(a) static
(b) void
(c) null
(d) public
(xiv) Assertion(A): When two or more loops are defined in a program,
it is said to be nested loop.
Reason(R): In a nested loop, the inner loop gets repeated each time the outer loop
executes.
(a) Both Assertion (A) and Reason (R) are true and Reason (R) is a correc
t 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
______________ , __
Std. X - Computer Applications First Terminal Examination-2024-25
Page 4 of 11
(xv) Read the following text, and choose the correct statement:
red with the same datatype. This is
An array is the concept of using a number of variables decla
the reason why an array is said to be a composite datatype.
System.out.println(str.length( ));
(a) 2
11001100
11001100
(b) 4
11001100
..
2200 "
(c) 3
2200
11001100
(d) 4
2200
11001100
d.
(xvii) Assertion(A): Call by value method is known as pure metho
are perfonned
Reason(R): The original value of variables does not change as operations
on copied values.
(a) Both Assertion (A) and Reason (R) are true and Reaso
n (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
---X--- ---Appli
---uter --------------------------
--cations·-------------------Exarn
Std. - Comp First Terminal ination-2024-25 Page S of 11
(xviii) Passwords are stored as two Strings:
. pw must be checked
If String with
. String
. wp, for vaI'd' h' h one of the following String
1 1ty, w ic
(a) charAt()
(b) equalto( )
(c) equalslgnoreCase( )
(d) startsWith()
(xix) For the given code snippet, the output will be:
int a;
System.out.println( );· _·
..,
:1:',(
System.out.println("a=" +:a);· J;..
•. ........ ❖
.· ... 'I:'.,,, ..•
(a) a=IS
(c) a=I0
(4) a=9
(xx) \1/}tlch of the following should be used to find the number of elements present in Cities□?
•• l
• . (a) Cities.length
(b) Cities.lengthO
(c) length(Cities)
(d) Cities.sizeO
(vi) Write a method prototype for a function terminal which accepts a integer and a character [2]
and returns true or false.
- - - -------------------------------------------------------------------------
Std. X - Computer Applications First Terminal Examination-2024-25 Page 7 of 11
(vii) Give the output of the following program segment and mention
how many times the loop
will execute:
int i = 1, k=l;
while(i++<G)
{
k*=i;
System.out.println(k);
}
(viii) Write the output of the following String methods: [2]
String A= "LoCkEt" .substring(0,4);
System.out.println(A);
System.out.println(A.compareTo(B));
(ix) Consider the following code and answer the question given below [2]
:
class Planet
{
static int x; int y;
void access (int z)
{
int a, b;
Planet Mars=nev,rPlanet ();
System.out.printl~(l(R.~d Planet");
}
a) What is the name of the object of the given class?
b) Name the instance variables used in the program.
c) Write the local variable used in the program.
d) The function in the given snippet is passing the argument using
the technique:
( 1) Pass by value
OR
. (2) Pass by Reference
(x) State the output of the following snippet: [2]
int m[]={9,25,17,5,44}; .
int m(0] =ll; m(l]= m(4]; int p=m[ 0]+m [l];
System.out.println(p );
doubl e y=Math.sqrt(m[0]+m[3]);
System.out.println(y);
-----------------------------------
Std. X - Computer Applications First Terminal E~amination-2024-25 Page 8 of 11
SECTION - B (60 Marks)
(Answer any four questions from this Section)
in BlueJ Environment or any other program
~e answers in this section should consist of the programs
written using variable description I mnemonic
envrronment with java as the base. Each program should be
Flowcharts and algorithms are not required.
codes so that the logic of the program is clearly depicted.
the programs.
Buffered Reader/ Data Input Stream should not be used in
[15)
Question 3.
Define a class with the following specifications:
Class name MutualFund
Member variables
double base to store the base amount invested
int n to store the duration of the investment in years.
double ror to store the rate of return
doublemv to store the maturity value of the investment
Member methods:
MutualFund( ) default constructor to initialize data members.
tment.
void input( ) to accept the base amount invested and the-duration of the inves
tions:
void compute( ) to compute the maturity val9e 6ased-dJ the following condi
Duration
<>
< Rate of return
l>
methods.
Write the main method to create an object and call the above
(15)
Question 4.
each vowel by immediate next character and
WAP to create a code from the accepted string by replacing
remain unchanged.
each consonant by the previous character. The other characters
SAMPLE INPUT: **education@2020**
OUTPUT: **fcvbbsjpm@2020**
-----------------------------------------------
------------------- --- ------------------------------------------
Std. X - Computer Applications First Terminal Examination-2024-25 Page 9 of 11
Question 5.
· . llS \
Design a class Pron1c to . · •
check if an accepted nu ber or not. (A number
be Pronic if the product mber 1s a Proruc num 1s said to
of two consecutive numb . lf
ers is equal to the number
Example: itse •
0 =0 x l
2= lx 2
6= 2x 3
12 = 3 X 4
thus, 0, 2, 6, 12 ... are pro
nic numbers.
Question 6.
Define a class to overloa (15]
d the
method showO as follow
s:
void show Q: To print the
following pattern using for
loop.
• PARIS
PARI
PAR
PA
p
Question 7.
Write a program to acce [15]
pt 6 elements in an array
R, containing all elements P, and 4 elements in an arr
of array P and Q. Display ay Q and produce a third arr
EXAMPI:,E: the resultant array ay
IN PU T
OUTPUT
P[ ] Q [] R []
4 19 4
6 23 6
l 7 l
2 8 2
3
3
10
10
19
23
7
8
--------------------------------
------------------------------
Std. X - Computer Applications •
-- --------------------------------------
n-2024-25
Page 10 of 11
.,.t, "@ues ti'on 8. (15)
Foilowing is the COPA of the student who appeared for their college final semester.
7-6, 9.1, 8.2, 5.4, 4.3, 5.1, 6.6, 8.9, 8.0, 9.5
Design a class injava to accept the value from the user and find whether the accepted COPA is present in
the list or not. If it is found display the message "COPA found" otherwise display the message "COPA
not found".
••••••••••••••••••••••••••••••••
-------·------------------------------------------------------------------------------------------------------------------------------------------------
Std. X - Computer Applications First Terminal Examination-2024-25 Page 11 of 11