0% found this document useful (0 votes)
12 views5 pages

TBS Undri, Class IX Final Paper Suhani M.

The document appears to be an examination paper for a computer science course, covering topics such as class abstraction, data types, and Java programming concepts. It includes various questions related to programming logic, output prediction, and code conversion tasks. Additionally, there are programming exercises requiring the implementation of specific algorithms and patterns.

Uploaded by

skmirpuri40
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)
12 views5 pages

TBS Undri, Class IX Final Paper Suhani M.

The document appears to be an examination paper for a computer science course, covering topics such as class abstraction, data types, and Java programming concepts. It includes various questions related to programming logic, output prediction, and code conversion tasks. Additionally, there are programming exercises requiring the implementation of specific algorithms and patterns.

Uploaded by

skmirpuri40
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

the

statements
class abstraction
d)data usertype
school. the B. each)
mark
(one as
100
Marks-
theminutes
writinaSection
in
aiven
[20]
Mks
Tot another java
d)object keyword
d)
the
after Math.abs(known
is
Math.max(-remaining
4,-2)
by paner
from
forSections
are from aof
component d)exic)fotr-type
controlledmode d)shorthand
d)4.0 operands,
is
provided allowed questions
questions properties loop. data d)mixed
UNDRI 15 question c)Inheritance
b)Encapsulation
a)Polymorphism as ofprocessing
APPLICATIONS
COMPUTER
2022-23 Max
EXAMINATION
FINAL first option
c)function iterative known
another
pperthe tiime
two Marks) two
SCHOOL, the four questions
allAttempt correct c)literal
individual c)coercion
during theinto ofparts
reading the on fixed to is c)2
with
c)binary
any
(2Hours) ne is divided brackets[] (40 acquires stresses Conversion
converted deals skip
of5
1Page
CO-ED on write Paper andor the
witten questionsA SECTION languageeach
a expression arithmeticcanisiteration
in is A
to spent Section
thisPaper
write
class b)coding
as
defined b)implicit whichoperator.
BISHOP'S allowedheadof and
as b)token
defined b)whileqetstype b)-4.0 operatorb)unarythat
be
must be Thisfrom answerawhich
statement
to
for
marks
oriented isloop type
the the next
be is theanswers.
questions is intervention,of data aritthmetic
Paper by
THE not timeat intended correctDrocess Procedure statement. a)do-while
a)identifier the
Conversion.
a)explicitoutput
to
umpjup
asknown
is
thiswill Thisgiven a)ternary
YoU all
1.Question
the The a)data When Thea)2.0 Iheand
-IXto
Answerstime Attempt
Class The An
Choose 3.A 6. 7. b.
The 1. 2. 5.
4
d)for
c)return
a)break b)continue
9. Predict the output:
int a=14, b=2;
if(a>b && a%b==0)
System.out. printin(a ++);
else
System.out.printin(--a); d)7
a)15 b)14 c)13
10, Predict the output of the code snippet.
int i=0;
for(i=5; i>1; i-)
if(1%2==0)
break;
System.out.printin(i);
a) 1 b)4 c) 2 d)5
result in true or false:
11. Indicate whether the following statements
int a=10, b=20;
if( (a<b) ||(a==b)) d)o
a)true b)false c)1
an object or
12. This is a special purpose literal used to initialise
reference variable. literal
a)boolean literal b)Null literal c)String literal d)float

of an object. It also reflects the


13. It is represented by the attributes
properties of an object. d)function
a)state b)behaviour c)identity
all its components of same data
14. Anarithmetic expression that uses
type is known as expression.
b)impure c)mixed d)coercion
a)pure
the ternary
15. What will be the value stored in t, after solving
expression:
int a=-2, b=2;
double t=(a<0 && b>0)?2*a:2*b;
a)4 b)4.0 c)-4.0 d)2
m.
16.Jf intp=6; then double m=p%4 - ++p; find the value of

a)-5.0 b)p=6 c)-5 d)1


type
17. How many bits are reserved for achar data
a)8 bits b)16 bits c)32 bits d)128 bits

18. char x='A;


Page 2 of 5
int u=x;
What
a) 65 value is stored in u?
b)91 c) 66 d)90
19. Write the Output of the below java
program segment:
a)4 System.out.println("2"+1 +1);
b)2=11 c)2= 2 d)2= 11
20. The keyword is used to allocate space in the dynamic memory
for the storage of data and functions belonging to an object.
a)state b)new c)instance d)static

Question 2. (two marks each)

Kewrite the following snippet using while loop instead of for loop.

int f=1,;
for(i=1;i<=5;i++)
{ f*=i;

System.out.println();
(D) Predict the output for the following: int x=4;
X+=(*++)+(++x)+x;
(c) Given the output of the following code :
i) Math.abs(Math.ceil-4.6);
i) Math.round(Math.cbrt(125));

(d) Predict the output of the folowing snippet:


int i=1, p=0;
do

p=p+i;
System.out.print(p+* ");
itt;
}while(i<5);
(e) Give the output of the snippet:
int a=1;
while(++a<=10)
if(a==5)
break;
System.out.printin(a);

() Convert the ternary structure to if-else structure


comm = (sale>10000)? sale*5/100:0:

Page 3 of 5
(9) Wite java exptession for A
statement
(h) witchcse
CoIvert the following f else' stuctuointo
if(cha Y)
{xx-10; System,out.println(x),}
else if(chy)
(x 10; System.out.println(x):)
() Correct the errors In the glven progran:
int a=45, b70, c65.45:
suma+b;
diff=c-b;
System.out.println(sum,diff);
() Convert the following while loop into do while loop
int m=5,n= 10;
while(n> 1)
{System.out.println(mn);

SECTIONB (60 Marks)


this Section
Attempt any four guestions from
in either Blue
answers in this Section should consist of the Programs the base.
The environment with Java as
environment or any program Variable descriptions/MnemoniC
be written using
Each program should of the program is clearly depicted.
Codes so that the logic required.
Flow-Charts and Algorithms are not
[15]
Question 3. sum of only negative
the
any 10 numbers. Display
Write aprogram to accept only).
numbers. (Use do while loop
[15]
Question 4.
compute the sum of the following series:
Write aprogram to
3 5 19
1
20
|15]
Armstrong number or
Question 5.
tocheck whether a number isan
Write ajavaprogram
not. 3-|+ 125 4 27 153
Eg 153:1 S ' +

Page 4 ol 5
Question
Write a 6. (15)
program to print the pattern as foliows:

543
S432
54321
Quest
Write aioprogram
digit
n7. [15)
to check whether the number entered by the user is a one
number
display the or a two digit number or athree digit number. Otherwise,
message "The number enteredis more than three digits".
Use the if-else
structure only.
Question
Write
8. (15]
a menu
of a rectangle driven
as per program
the user'stochoice.
calculateAccept
and display the area
the length and orbreadth
perimeter
of a
rectangle.
Hint: area=length*breadth

Perimeter=2xiength+2*breadth

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