0% found this document useful (0 votes)
15 views10 pages

MCQ and Logical 4 Prelims Ans in Last Page

The document contains a specimen paper for a Computer Applications exam, featuring multiple-choice questions, code evaluation, and programming tasks. It includes questions on Java programming concepts, syntax errors, and constructors, along with a marking scheme for grading. The paper is structured into sections with specific instructions for answering each question.

Uploaded by

prachir741
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 views10 pages

MCQ and Logical 4 Prelims Ans in Last Page

The document contains a specimen paper for a Computer Applications exam, featuring multiple-choice questions, code evaluation, and programming tasks. It includes questions on Java programming concepts, syntax errors, and constructors, along with a marking scheme for grading. The paper is structured into sections with specific instructions for answering each question.

Uploaded by

prachir741
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/ 10

SECTION A

(Attempt all questions fromthis Section.)

Question 1 [20]
Choose the correct answers to the questions from the given options.
(Do not copy the question, write the correct answers only.)
()

Name the above structure:

(a) One dimensional array

(b) Two Dimensional array with 4 rows and 5 columns


(c) Three dimensional array

(d) Two Dimensional array with 5 rows and 4 columns |Analysis]

(ii) "Java compiled code (byte code) can run on all operating systems"
- Name the feature.

(a) Robust and Secure

(b) Object Oriented


(c) Platform Independent
(d) Multithreaded [Understanding|

(iii) The size of n'is:

(a) 2 bytes
(b) 4 bytes
(c) 8 bytes
(a) 16 bytes |Recalll

T25 861-SPECIMEN 2 of 12
(iv) Identify the operator that gets the highest precedence while ||
evaluating the given expression:
a+b% c*d-e
(a) +

(b) %
(c)
(d) [Analysis)
(v) Which of the following is a valid java keyword?
(a) If
(b) BOOLEAN
(c) static
(d) Switch [Understanding|
(vi) The output of the following code is:
System.out.printin(Math.ceil(6.4)+Math.floor(-1-2):
(a) 3.0
(b) 4
(c) 3
(d) 4.0 |Analysis]
(vii) Which of the following returns a String?
(a) length)
(b) charAt(int)
(c) replace(char, char)
() indexOf(String) [Understanding|
(vii) Which of the following is not true with regards to a switch
statement?

(a) checks for an equality between the input and the case labels
(b) supports floating point constants
(c) break is used to exit from the switch block
(d) case labels are unique [Understanding]

T25 861 - SPECIMEN 3 of 12


(ix) Consider the array given below:
char ch[]={"A,ET'¡, 'U}:
Write the output of the following statements:
System.out.println(ch[0]*2);:
(a) 65
(b) 130
(c) 'A'
(d) 0
|Analysis]
(x) To execute a loop 10 times, which of the following is correct?
(a) for (int i=1 1;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;j<=21;i++) [Analysis]
(xi) Asingle dimensional array has S0 elements, which ofthe following
is the correct statement to initialize the last element to 100.

(a) x[51F100
(b) x[48]-100

(c) x[49F100
(a) x[50}100
[Analysis]
(xii) Method prototype for the method compute which accepts two
integer arguments and returns true/false.

(a) void compute (int a, int b)


(b) boolean compute (int a, int b)
(c) Boolean compute (int a,b)
(d) int compute (int a, int b) [Understanding|

T25 861- SPECIMEN 4 of 12


(xii) The statement that brings the control back to the calling method is:
(a) break

(b) System.exit(0)
(c) continue
(d) return [Recall]

(xiv) The default value of a boolean variable is:

(a) False

(b) 0

(c) false

(d) True |Recalll

(xv) The method to convert a lowercase character to uppercase is:


(a) String.toUpperCase( )
(b) Character.isUppercase ( char )
(c) Character.toUpperCase( char )
(a) toUpperCase () |Recall)
(xvi) Assertion (A): Integer class can be used in the program without
calling a package.
Reason (R): It belongs to the default package java.lang.
(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 |Application)

T25 861- SPECIMEN 5 of 12


(xvi) A student executes the following code to increase the value of a
variable 'x' by 2.
He has written the following statement, which is incorrect.
x=+2;
What will be the correct statement?
A. x+-2;
B. x=2;
C x=x +2;

(a) Only A
(b) Only C
(c) All the three
(d) Both A and C [Analysis]
(xvii) The statement used to find the total number of Strings present in
the string array String s] is:
(a) s.length
(b) s.length)
(c) length(s)
(d) len(s) [Analysis]
(xix) Consider the following program segment in which the statements
are jumbled, choose the correct order of statements to swap two
variables using the third variable.
void swap(int a, int b)
{ a=b; ’(1)
b=t; ’ (2)
int t =0; ’(3)
t=a; ’ (4)

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


(b) (3) (4) (1) (2)
(c) (1) (3) (4) (2)
[Analysis]
() (2) (1) (4) (3)
T25 861-SPECIMEN 6 of 12
(xx) Assertion(A): An argument is a value that is passed to a method
when it is called.

Reason(R): Variables which are declared in a method


prototype to receive values are called actual
parameters

(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 [Application]

Question 2

() Rewrite the following code using single if statement. [2]


if (code-'g)
System.out.printin ("GREEN ");
else if (code-='G)
System.out.printin ("GREEN "); [Understanding|
(ii) Evaluate the given expression when the value of a=2 and b=3 [2]
b*=a++-++b+ tta;
System.out.println ("a= "ta);
System.out.printin ("b= "+b); [Analysis]
(iii) A student executes the following program segment and gets an [21
error. Identify the statement which has an erTOr, correct the same
to get the output as WIN.

booleanx= true;
switch(x)
case 1: System.out.println ("WIN"); break;
case 2: System.out.printin ("LOOSE");
[Analysis<l

T25 861-SPECIMEN 7of 12


(iv) Write the Java expression for +y [2]
[Understanding|
(v) How many times will the following loop execute? Write the [2]
output of the code:

int x=10;

while (true) {
Systen.out.printin (x+tt * 2);
if (x%3-=0)
break;

[Analysis]
(vi) Write the output of the following String methods: [2]
String x= "Galaxy ", y= "Games ";

(a) System.out.println (x.charAt(0)=y.charAt(0);


(b) System.out.println (x.compareTo(y)); [Analysis]
(vii) Predict the output of the following code snippet: [2]
char ch=B';

char chr= Character.toLowerCase(ch);


int n=(int) chr-10;
System.out.println(char)n+"t"+chr);
(viii) A student is trying to convert the string present in x to a numerical [2
value, so that he can find the square root of the converted value,
However the code has an error. Name the error (syntax / logical.
runtime). Correct the code so that it compiles and runs correctly.
String x= "25";
int y=Double.parseDouble (3);
double r-Math.sqrt (y);
System.out.println (r); [Analysis]

T25 861- SPECIMEN 8 of 12


(ix) Consider the following program segment and answer the questions [21
below:

class calculate

int a; double b;

calculate(0

a-0;

b-0.0;
}
calculate(int x, double y)
{

bry;

void sum)

[Analysis]
System.out.printin(a b):

Name the type of constructors used in the above program segment?


(x) Consider the following program segment and answer the [2]
questions given below:

int x[][]={{2,4,5,6}. {5,7,8,1}, {34, 1,10, 9}};


(a) What is the position of 34?
(b) What is the result of x[2][3] + x[1][21? [Analysis]

T25 861 - SPECIMEN 9 of 12


ICSE 2025- SPECIMEN PAPER
DRAFTMARKING SCHEME - COMPUTER APPLICATIONS

Question 1 [20]
(1) (b Two Dimensional array with 4 rows and 5 columns
(ii) (C) Platform Independent
(ii) (a 2 bytes
(iv) (b) %
(v) (c) static

(vi) (d) 4.0


(vii) (C replace(char, char)
(viii) (b supports floating point constants
(ix) (b) 130

(x) (a) for (int i-11;i<-30;it-2)


(xi) (c) x[49}-100
(xii) (b boolean compute (int a, int b)

(xii) (d) returm

(xiv) (c) false


(xv) (c) Character.toUpperCase( char )
(xvi) (a) Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation
of Assertion (A)
(xvii)(d) Both A and C
(xvii) (a) s.length
(xix) (b (3) (4) (1) (2)
(xx) (c) Assertion (A) is true and Reason (R) is false

Question 2
(i) if (code ='g'| code =G')
System.out.printin("GREEN");

(ii a=4, b=6 [2]

(i) Statement with error - boolean x-true ; To get the required output - int x =1; [21

T25 861-SPECIMEN 1of 7


(iv) Math.cbrt(x) + Math.sqrt(y) [2]

(v) Loop is executed two times (2]


20

22

(vi) (a) true (2]


(b) -1

(vii) X b [2]
.

(viii) Syntax error, double y = Double.parseDouble(x) [2]

(ix) Default constructor, Parameterized Constructor [2]

(x) (a) x[21[0] [2]


(b) 17 (9+8)

Question 3

import java.util.*; [15]


class bank

{
double p,n,r,a;
Scanner ob = new Scanner(System.in);
void accept()

System.out.printin("Enter principal");
prob.nextDouble):
System.out,printin("Enter number of years");
n=ob.nextDouble);

void calculate()

T25 861 - SPECIMEN 2 of7

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