0 ratings 0% found this document useful (0 votes) 37 views 4 pages Computer Preboards
The document is a pre-board examination paper for Computer Application at Madonna English School, Darbhanga, for the academic year 2022-2023. It includes multiple-choice questions, coding exercises, and programming tasks covering various concepts such as data types, encapsulation, search algorithms, and class definitions in Java. The exam is structured into sections requiring students to demonstrate their understanding of computer science principles and programming skills.
AI-enhanced title and description
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here .
Available Formats
Download as PDF or read online on Scribd
Go to previous items Go to next items
Save Computer_preboards For Later MADONNA ENGLISH SCHOOL, DARBHANGA
Pre-Board Examination 2022-2023
Chae X FM 280
Subject : Computer Application Time! 2 Firs,
SECTION A [Attempt atl]
1. Choose the correct answer nnd welte the correct options only. [1120-20]
ny Array isa data type,
4. knteger itl, Composite
ii, String iy. nixed
1) Which of the following concept ean be used for encapsulation?
i. weapping date with methods, iii, using interface
ii, Hiding data using acveys modifiers iv. Allthe above
} Which of the following methoul van he used to join two strings?
iwima) concat ¢)
ii, concatenate () iw join)
4) The Keyword to create an object of w class is
create ili, New
ii, new iv. NEW
¢) Date type int is inchuded in... Wrapper clases
i. Integer iii, int
ii, float iv. Interface
1) Conversion fiom primitive type 10 wrapper wbject is called
i. boxing iii, autoboxing
vi, unboxing, jv, type casting
\y) Name the senrch procest whieh compares the svarcit walve with the middle element of the array
steach singe
i. Linear Seorch
Wii, Selection Searely
ii, Binary Search iv, Insertion Search
1b) What is the return value of equals)?
ia iH, Boolean
string iv. Float
iy Name the type of error in the Statement uiven below. double X: Ys 2:
i Logical error iii Runtime error
il, Syntas error iy, No error
J) ____isknownas object factory:
i, Amay Hii, class
metliod iv, Data
4) What will be the output of foltowing code?
String al = "48", 02 ="64";
int tot= Imeger. Perse Ini (n}) + Integer. Purse Int (12);
Sopen ("Tlie sum of" + "46" + "and? "64" + "is" » told
i. The sum oF 4G and 64 is 110 iii, Error
ii. The sum of 46 and 64 130.0) wv. Out of memory
4) What is the vuiput of Following code?
char eh='y"
char chr = Charneter, to Upper Case (eh);
ini p= Gino she,
System, oul printla (chr + "Wt" +
89 iti, Vax
ii, YL iy. Y90
dager olaim) The Keptwond which maker claus members necesntble outside clays in which they are dectesed,
4 Private Hh, Putte
Hi Protected iv Hidden
oy Which of the following is wsed to initia the Tustonces af clasy?
A Arrays lil. Objects
Wi Strings iy, Constructor
6) The operator which works om otte operand fs
1 binary ih unary
it, ternary WW Relational
pp) Which element is represent by af 11]?
i 10 wi 1
tr iv. None of the above
46) The heyword used to inherit the propertis a a class hy nnother class is
1 Extends iii, super
it extends iv new
8) What is the output of the given code’?
System. out panting Math,
1140 ii, 16.0
i iso iv, 170
+) The statement used to transfer contra! to other parts af program.
& Nerative iH. Loop
A Jump iv. Conditional
#) The concept of having more than one constructor with different types of partmeter is called
Copy constructor iii. Constructor overioading
ii. overloading iv. Method Invoking
Attempt All 2 x10=20)
3) Evuate the expression where a= 10, b= 5.2=10
i 2~=ah~ +; System. oulprintin(#}: ii. System. out.printia (b+ +2 =—b):
bi Write Java expression for: |x? > xy Ip
€) Rewnte the following using temury operator
itty)
c
else
cau:
d) Rewrite the following while loop usine for lap,
im x= 5;
While (x <= 5)
t
Mee
System. out. peintin (x);
©) How many times the following loop will xed executed? Give the output also
int
Mo
{ System. outprintin Ce)
J while Ory C= 4)
1). Syatern, outprintin (MISSISSIEE replace 8.4. to Lower ease 9
2), Syscon out printn¢" REDUCE" Compare a WEYL") PANTARTICAS Last Index OCA):
AY Winte the prototype of w function thet accepts a bwoleun value but does ct return eny thin
iy ita] ]= 48, 5.2,7,9. 4046.31
ve output for the following using the above array:
System. out printint Math ows (a4), uf2 1):
Pazezote e160System, out printin(Maih. §
. aS Sart (alo) + afuy));
i) White the output ofthe given cane et” AP!
Ilya)
‘
sowtd;
Systein, out. printin (x);
Continue;
)
ee
(Sytem, out printin (4459;
break:
J while (x<10)5
Se
im
Attempt any four [1sts=60)
Write varichte description for every progsurn. 1 marks will be awarded for correct variable
description
TL. Define a class
th the following specification:
Class name: Employee
Dats members :
interno = employes number
String name == nine oF enipluyse
int aye age DF the emple
im basic + basic salary
Methods Methods
Void accepts |) Input employee detaid
Void valoulaie@ - Calculate ner sala
8 per the given specification.
fret = basie = hee + da ~ pe
ra = 18.3 % of basie
Wa = 175 6 of basic
ve
Whe age of the employee is above Rs.SU he/she gets an
auditional allowance of Rs. $000/~
oid print, = Le print the details as per the given tormat
Eno
104 of basie
name Axe Basic Net
Write the name () method and invoke the method using an abject
IV. Define a class to overload the method print () as follows:
Void print () to print the patter
t
4 3 6
7 8 9 to
Noi teas
page 3.ot4ve
vi.
vo.
7.
widenay number a number is
Boolean print (int n) - ‘To check whether the number is aD:
Dedeney if ihe Cube of the Sum of the digits is equal to the
number itselt, Ex $12 = (5+ 1 + 2) = (8) = 512. St returms
true for Dudeney number and false for non Dudeney no-
or ch = 'S! print the Square of the oumber or Print
otherwise print the cube.
Void print ( int a, char ch) - if eh
cube of the numbe:
ort them in descent
Define a class to accept 10:names in n string array and s
ay and sorted array both.
order using bubble sort method, Print the original are
f size 20, and print the range
Define a class to accept double vaiues into an array’ o!
of the array.
[Range is the difference between the largest and smallest value of the array}
Define a class to aecept a string and print (he same in reverse also print the number
of vowels in the string.
|A string array contaius 10 names aud sort diem in ascending order, Write 8
Linear Seareh method. 1f
program to iaput a name and search it in the array using
it in the array. If it is not found
the name is found then print the position of the
then print an appropriate message. Also print the names which begins wit the
word "SRI".