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

Arihant- Computer 12 icse class 10

Uploaded by

scrai1945
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)
59 views

Arihant- Computer 12 icse class 10

Uploaded by

scrai1945
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/ 5

SQP Code : PB-12/15 Series i-Succeed 12-25/15 RollNo.

Sample Question Paper 12


Computer Applications 10" (Code 86)
beneral Instructions
1. Answer to this paper must be written on the paper provided separately.
2. You will not be allowed to write during the first 15 minutes. This time is to be spent in
reading the question paper.
3. The time given at the head of this paper is the time allowed for writing the answers.
Time:2 Hrs.
Max. Marks:100
4. four
This questions
paper is divided into two sections. Attempt all questions from Section Aand any
from Section B.
5. The intended marks for questions or parts of questions are given in brackets [ ].

Section AAttempt all questions from this section.


1. ChOOse the correct answers to the questions (iv) Consider the expression 3 +4*2which
from the given options. [20] operator has highest precedence?"Anais
(i) Given the following 2D array: Analysis (d) 4
(a) + (b)* (c) 3
Column0 Column 1 Column 2 Column 3
Row 0 2 3 4 5
(v) The statemernt (1 > 0) |(1<0) evaluates
to " Understanutine
Row 1 6 7 1
(a) 0 (b) 1 (b) false (d) true
Row 2 10 11 12 13

What is the value at array[1][21?


(vi) What is the output of Math.ceil-0.7?
"Aniss
(a) 1 (b) 12 (d)1.0
(a) 0.0 (b) 0 (c) 1
(c) 11 (d) 4
(vii) Which method would you use to coma
(ii) Which clause isoptional in the switch two strings for equality in Java?
" Understrnbn
statement? . Understanding
(a) default (b) case (a) -= (b) equals()
(c) switch (d) None of these (c) compareTo() (d) compare) Canbe
types
(iii) Errors occur in a program when " Recall
(viii) Which of the following data Javàr in Understanatig
(a) Syntax of the programming language is not used in a switch statemnent
followed
(b) the program does not run properly or does (a) int, char, String
not execute at all (b) float, double, long
(c) The program produces an incorrect result (c) boolean
(d) All of the above (d) All of the above
QuestionPaper12

given below: (xvi) Assertion Irhettzre in O?


iv)Consider the array 'A', 'I': allows a cdass (subdess, to acare
char ch[]-{ 'C'. properties and behaviors fro
following
Write the output of the"Analysis another class (superdass
statements:
System.out.println(ch[2]*3): Reason Irheriterce proccies coóe
(b) 252 reuse and facitzes the creatm f
(a)84
(c)253 (d) T hierarchical relationships betree
times "Analysis classes.
(x) How many
2: (a) Both assertion 2d reason e t e
int j =
do
and reason is the corzect erpiz
of asserion
(b) Both assertion zdre2sn 2 e
j *= 2; but reason is not he coret
) while (j <= 24); explanation of 2ssertm
executes?
(c) Asserion is true, but re2sn is alse
(a)5 (b) 4 (c) 3 (d) 2 (d) Assertion is false, but re2s is e
17) ; it
(xi) Given array int Z[]={15, 16, (xvii) Astudent executes the folowig
will occupY .bytes in code to divide the value of 2
memory. .Analysis variable 'n' by 4. He has wita he
(a) 3 (b) 12 following statement, wi is
(d) 64 " Araiyss
(c) 24 incorrect.
(xii) Which of the following statements n/4;
is true about methods in Java? What will be the correct stan
. Understanding
(a) A method can have multiple return A. n4;
statements. B.n=4;
(b) A method can have multiple method Cn=n4
signatures. (a) Only A ()Only C
(c) A method can have multiple (c) All of these (d)Both (2) 2nd(c)
parameter lists.
(d) Amethod can have multiple access (xvii) Which method in the String dass s
modifierS. used to retrieve the character at a
specific index? .Arzss
(xii) Which keyword is used to define a (a) charAt(int index)
method in Java? Recall
(b) getChar(int index)
(a) method (b) define (c) characterAt(int index)
(c) function (d) void (d) charAtIndex(int inder)
(xiv) Which 0OP concept emphasizes
grouping similar objects into classes (xix) Arrange the following codeeate
snippets in correct order to
and defining the properties an array of integers and print its
(attributes) and behaviors elements:
(methods) of those classes? . Recall
(a) Encapsulation A.)
(b) Inheritance B. int[] numbers (1, 2,3,451;
(c) Abstraction C. System.out.print(numbersi]+":
(d) Class and Object D. for (inti - 0; i< numbers.length;
(xv) Which Java version introduced
autoboxing and unboxing? " Recall E. public cass ArrayExample
(a) Java 5 (b) Java 6
(c) Java 7 (d) Java 8
120 iSucceed Computer
Applications
F. System.out,println("Elements of
the array:");
G. public static void main(Stringll
System.out.println
("Message: + message);
|| Typ0 1n the
args) ( println
(a) E, G, B, D,E, C, A
(b) E, G, B, E, D, C, A System.0u.println method
(c) E, G, B, D, C, E, A
("Printing another
(d) E, G, B, D, E, C,A
(xx) Assertion In Java, method
(iv) Write the java
message.");
overloading allows a class to have expression for a +h3
multiple methods with the same
name but different parameter lists. (21
. Understanding
Reason Method overloading (v) The following Code has
improves code readability and Rewrite the correct codesome
and errors).
eliminates the need for multiple underlining all the corrections made.
method names. " Ayplication
integer counter=0; (2]
(a) Both assertion and reason are
true, i = 10; num;
and reason is the correct
of assertion. explanation for(num=i ;num>=1;num--);
(b) Both assertion and reason are
true, If 1%num-0
but reason is not the correct
explanation of assertion.
(c) Assertion is true, but reason isfalse. i counter=counter+1;
(d) Assertion is false, but reason is
true. "Analysis
2. (i) How many times below loop (vi) Write the output of the following
execute? string methods:
[2] [2]
int a = 1, b = 2; String x="pen", y="pet";
int c = ++b: (a) System. out.println(x.charAt
int d = a+t; (0)==y.charAt(0) ):
System. out.println("Value of (b) System.out.println(x.charAt
C: "+ (+t+c)); (1)==y.charAt(1)): "Analysis
8P-12 System.out.println(" Value of
d: " + d): (vii) Predict the output of the following
. Understanding code snippet: [2]
(iü) Evaluate the given expression when char ch='V':
the value of a-1 and b=5 char chr=Character
[2]
.toLowerCase(ch):
a += b++ * --a " Analysis
escint n=(int) chr-10;
System.out.println ("a= "+a): System.out.println((char)n+
System, out.println ("b "+b); t"+chr); Analysis
(iii) Identify the error in the below code (viii) Identify the error in the below code
to print the output [2] (2]
public class Main "Analysis public class Error

public static void


public static void main(String[] args)
main(String[] args)
acoint num- "Hi":
String message "Hello, System. out.printin
("Number:" + num)
World!";
Paper12
Question 121
ample
public static vo1d
"Analysis
the
main(String[] args)
(iN) Identify the constructor in
below code: [2] Empl0yee empl new
public class Employee Employee("Alice", 35);
Employee emp2 - new
private String name: Employee("Bob" , 20):
private int age;
public Employee "Analysis
(String empName, int (x) Consider the following program
empAge) segment and answer the questions
given below: [21
name = empName:
int x[][]-{1,m},{n,o},
age = empAge; p,q).tr,s}}:
System.out.println
("Creating employee " + (a) What is the position of 1?
name + aged + age): (b) What is the value of s? Analysis

Section BAttempt any four questions from this section.


3. Define aclass called with the following 4. Define aclass to accept 10 different
specifications [15] decimal numbers (double data type) in
" UnderstandinglAyplication a Single Dimensional Array (say, A).
Class name Eshop Truncate the fractional part of each
Member variables number of the array Aand store their
String name name of the item purchased integer part in another array (say, B).
double price Price of the item purchased [15]
Member methods " UnderstandinglApplication
void accept) Accept the namne and the price of 5. Define a Java class StringConverter that
the item using the methods of accepts a string and modifies it
Scanner class. according to the following rules: [15]
void calculate() To calculate the net amount to be
paid by a customer, based on the
" Convert all consonarnts in the string tobl 12
following criteria: uppercase. " UnderstandinglAyplication
Price Discount
" Replace all spaces in the string with '1'.
1000-25000 5.0% 6. Define a class to accept values into 15
25001-57O00 7.5% array and find and display the sum of
57001-100000 10.0% each row. [15]
More than 100000 15.0% UnderstandinglApplication
void display() To display the name of the
item 7. Define a class to accept a number and
and the net amount to be paid.
check whether entered number contains
Write the main method to create an duplicate number or not. [15]
object and call the above methods. . UnderstandinglApplication
122 iSucceed Computer Applicatlons
8. Define a class to overload the method vold dinplay(int n) To prlnt the
display as follows [15] of each digit mquare
of the tot
UnderstandinglAppliatlon glven number
void display() To prlnt the following Example n4329
foriat unlng vented
loop Output 3.0
1
12
1414213562
123 1.732050808
1234 2.)
12345

Answers
1. ()(a) (ii) (a) (ii) (d) (iv)(b) (v) (d)
(vi) (a) (vi) (b) (vii) (a) (ix) (b) (x) (b)For answers, scan
(xi) (b) (xii) (a) (xii) (d) (xiv)(d) (xv) (a) the glven QR code.
(xvi) (a) (xvii) (d) (xviii) (a) (xix)(b) (xx) (a)

8P-12

You might also like