Professional Documents
Culture Documents
Computer Pre Boards
Computer Pre Boards
EXAMINATION / 2022-23
CLASS N
SUBJECT: COMPUTER FULL MARKS:100
APPLICATIONS TIME: 2 HOURS
b. class
C. public
Page 1
d. private
variable x ?
the final value stored in
What is
(iv double a -1.35;
Math.abs(Math.floor(a);
double x =
b. 2
c. 2.0
d. 1.0
in
package
available
are
() Wrapper classes
a. java.io
b. java.util
C. java.lang
d. java.awt
code:
of the following
Give the output
(vi) B="74.0";
String A "26.0",
double CDouble parseDouble(A);
.parseDouble(B);
Double
double D
=
System.out.println((C+D);
a. 26
b. 74
C. 100.0
d. 2674
is:
The access modifier that gives most accessibility
a. public
b. private
C. package
d. protected
a. next0
b. nextLine()
C. nextlnt()
d. Next)
Page | 2
C. Boolean
d. Int
int n-1000
while (n> 10)
n/10:
Syst
Howem.out.ptime
many rintlnthe(n):
a Loop is loop is executed and
b. exeeuted 2 times what is the
c.
Loop is executed 3 tinmes and output is 100output?
and the
Loop exccuted 2
is the
d.
Loop is executed I times and the output is 10
times and the output is 10.
Which of the output is 10.
data type? following is the default initial
a. null
value for a long
b. OL
C. Long 0
d. 0.0
System.out.printin(1 +10+s+1+10);
a. 1115
b. 1105110
C. 27
115110
xIV) Consider the following String array and give the output
String x[]={"SAMSUNG", "NOKIA", "SONY",
Page 3
"MICROMAN" "BLACKBERRY"}
System.oul.prindn(x/1)
SAMSUNG
b. NOKIA
c . B L A C K B E R R Y
MICROMAX
d
transfer back to the method call
Causes the control to
(AV)
a. NEW
b. return
C. new
d. break
function?
System.out.printin(p);
a. 80
b. 20
C. 200
d. runtime error
Page 4
(xix)
Statement
double datatotype
Convert mmmber
a
stored in
double a
string variahle
b
double ddString valued f (x). to
double d- string. (x)
d.
double d string Doible (x)
(xN) NextlDouble (x).
What will this
code print
int a|l-new int|5]. ?
System.onullut.print(arr|0]):
a.
b. 0
C. Any integer
d. 0.0
Question 2
() What is the value of m
after
m -
2
n =(q-p)> (p-9)?q-p): (P-9);
(show the working)
Section B
(Answer any four Questions
from this
section)
Attempt any four questions from this
this Section should Section. The answers in
consist of the Programs in either
environment or any program Blue J
base. Each environment with Java as the
program should be written using Variable
descriptions/Mnemonic Codes such that the logic of the
program is clearly depicted
Question 3
Define a class named BookFair with the following description: [15
Instance variables/Data members:
String Bname- stores the name ofthe book
Page | 6
.
uble
Membermethods
| Price
Less than or equal to Rs. 1000 Discount
More than Rs. 1000 and less than or 2% of price
Rs. 3000 equal 10% of price
More than Rs. 3000
15% of price
iv) void display)- To display the name and price
after discount. Write a main method to create an of the
book
and call the above
object of the class
member methods.
Question 4
(15
Design a class to overload a function Sum() as follows:
) int Sum int A, int B)- with two integer arguments (A and
B) calculate and return sum of all the even numbers in the
range of A and B.
Sample input: A=4 and B=16
Sample output: sum =4+6+8+ 10+12+14+16.
i) double Sum( double N) -with one double
arguments(N) calculate and return the product of
the following series:
sum 1.0x 1.2 x 1.4x... XN
Gii) int Sum int N) with
-
one integer argument (N) calculate
and return sum of only odd digits of the numberN.
Sample input N=43961
13
Sample output sum =3 +9+1=
Question 5
Define class to accept n integers and arrange
a
them in [15
and
bubblesort. Print the original array
descending order using
the sorted array.
Page 7
Question 6 into an array of size 20
Write a program
to input integer
elemenits
[15
operations:
the following
and perform
numbers.
odd
Product of the
Display
numbers
sum of the even
() Display
racecar etc.
Question 8
Define a class to accept the names of n students
in an array and check [15
[IS
linear search, if
name in the array using
for the existence of the given
if not found print the appropriate
found print the position of the name,
with vowels.
message. Also print the names which begin