0 ratings 0% found this document useful (0 votes) 45 views 20 pages Computer
The document discusses programming concepts, focusing on procedural and object-oriented programming languages, including examples like FORTRAN, BASIC, and Python. It outlines key principles of object-oriented programming such as encapsulation, inheritance, and reusability, along with definitions of variables and data types. Additionally, it covers topics like type conversion, escape sequences, and the differences between primitive and non-primitive data types.
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
ti) SE Mee tony catenin ok programaning wore
[pm ete pian ge
Dah | sure Oreste
a ©) nye Crsented programming,
0.2 Meme two procedure oriented and two object oriented programening, nGnaee
. 1D Two procedure oriented languages are “OKTRAN and BASIC
9) Too thet overt laggy ae Jae ea Python
10.3 Name four basic principles of abject orien’ progammening,
D tae
(i) otymonpane
i. ation
44 principle that allows a function t0 tbe used for multiple
SF theough the process of inheritance
inherits properties from a base cass
by ae” clase and “Derived
Satie a derives! cass
06 What docs rewability mean?
rr pens ued to perform 2 task sn base cam fe St
Sle for other bype of Proc
re This feature & known as newsablity
107 State the Java concept that is implemente* throws
eA cuperciase and a subclass
eared nepacocniting exert features of cass without socuding the background
ICSE 20131,
ICSE 20161
apa a " wn bbe used as a unit ©
De ceva of ds anf wo that ty 6
jenmed 2 Encapsaiation
sation of 2 ce
cse 20171
0.9 What i Inberitance?
Jed reusability
Indeertance is an OOP
ft promo
ple according
Ans
ICSE 2018),
another ass.
snd
pneraction? Explain with ar
Ne cate of a as wien Seer =
0.10 What is data
(Ams. itis an act oF 1
‘of ts iemportant parts (Sing
os are only awat
For example, wile driving 2 Ce, 77% Sr aad scent. By apy on of the
. ‘ crv the mal mechanism of the
Tent! features) viz. ct
San caop the car and thnes vo
Drake of car
oe ced nt PE
.a
© heirs
reins the Pmt free se
tae ©) startin
Fen
Aber Nee cats
©) stapes
The proces by shich » cine
1) potrmonphiwem 0) int
the ste Nal oe
) date 0 ete
Whach of the fotoming: is »
(4) atmeractice
om _ AA ee
Wes of the foiomring
vem aren Uh hove
&. The proces: of restricting; the fe flow
0) chee
Which of the Sodiowinng fs
Néep Tees sme feanctia
@) Uses same of
4) him mot a
3 bee procediore oriented programming, the stress is given ox
() Date Br Function (©) Obpect ) Cee
2 Cpe cam commamicate with cach other Guongh fyi oo: lie
tented pregame, Lamy
cone {0 mophan,
2 Ung 2 fection for meitipte operations ix catiea [8 414 rn
« Pots DLSVON 6 0 1.0 pecsenting ‘cates without inchaing
a ae
«bdo promotes the reumabiity tent, in abet remand
oremMSA
SES ait
- SPL 2 i
At AOE
aIn thas way real world objects and software objects are int
Why is a class called
Glass is the proto
type Hence, a clas j
ICSE 20134
Write a java statement to create am object mp of class digital
Java statement to create an object mpt «class digital
digital mp$ = new digital )on
Ane
o2
Ane.
3
Ane
os
Ans
os
Ans
Ans.
What is meant by boolean variable?
Boolean variable t 4 variable that Folds healewn
What is the difference between “t-e" and true?
true” (enciosed under double quotes) sa string Wieral wheress trae (without double
quotes) fa boolean eral
State the excape sequences for hocwontal tab and new line feed.
fal ta“ and for new fine feed ~
‘value, Le. trae or fale
Escape sexquences for hon
Is String type a primitive or non-primitive data type?
String ie a specific data tvpe that 1 framed using various character data types:
either 2 primitive nor a non primitive data type
In what way float initialisation is different from double type initialisation?
Ih heat type varie is initialised with a fractional value 2s O.0E whereas. 2 osbts
N00. The difference Between:
intialisations
For example
douiblle d-000D;
What is a variable?
Meese as a mamed memory locaina that i wed to contain a value that can RANE
Senattling on the circumctinces during the execution of 2 program.
Differentiate between pure and impure type expressions
A pure expr tas the ‘dre came data type whereas, an impure
eetsion contains elements of diferent data types
What is meant by type conversion How is
cexplist conversion?
on. the result needs to be obtained in a single speciic data
In @ mixed mode exp
type: Hence, the data type
18 Known as type conversion.
In an implicit ype conversion, the result of a mixed mode expression i obtsined
the higher most data type of the
For example, int a; float b; float c
c=a+b:
In case of explicit type conversion, the
choice and requirement
For example, int a; oat b; dow
b= oatya * 0:
averted to a required type. This process of conversion
ec
Give one example cach of a primitive data type and 2 composite data type.
type: im. Bloat, double, long, chat, etc. (amy one)
Examples of prim:
ay, class, interface, etc (amy one)
Examples of composi
State the values of n and ch.
char coh
int n=c#l
char che(chann . ACs 200
The value of
n=aso
we saosd «
‘
(20 Match the fotowing ters of Cok A with te wren of Cam 8
Catone A re
a, Pee +
ts tone
Nias a oehe
esas ie ioc
.« poem
002s eae
Am ot ws on on
ou Oe
L Multiple Choice Questions:
1 lata type occupies in the memory?
os «
ow
wr
2. Which of the following is a non-primitive data type? ‘
o) it > GB Sesing
3. Which of the following
{or Boolean at 2) double
Which of the following ade range is applicable for lowercase letters?
47-12 (5-10
@ ey ow all
atements are ‘True’ or ‘False’
whether the followi
of diferent chav acters used in a Java program. ic
L
iF
€
There are 128 se
The ASCII codes of uppercase letters range from 97 t0 122.
‘A variable gives the exact repr station of data.
The data types int, lot, char are called non primitive types.
A String literal is assigned to a ‘ring, variable
2
3.
et
A character literal is always encloved in double quotes
7 String constant can be written by using a set of alphanumeric
Iharacters
An object is said to be a non-primitive data. >
9. The data type int stores fractional values. ‘ =
10. Boolean type data is used to test a condition and results in
cither true or false. +1. Multiple Choice Questions:
= ae Of the felhorwing, i the conmect
ook ea
2. Choose the odd one out from the following:
@> oe on
Given: String, st = (a>= 90)? “Excellent”: “Best”
Predict the output, when a = 90.
Voss () Excellent: Best
(©) Best Excetient D-Eellent
4 Chome the odd one out from the follow ng;
(@) Unary operator (@) Binary operator
(©) Ternary operator bi twee operator
B Gree xo ance + te x4--x
Find the value, when 1-5,
a= 2 on wm
State whether the following statemer
1. The precedence of operators in Java follows BODMAS.
2 The output of a++ will be 1, if int 2
3. The relational operators always resull in terms of
4. Giver: int m=5; m™=5 then the valu J in m result
5. The statement (a-bMlela>c) une
6 W int 227, A, 0; then ¢ = aby resets im 3.
7. The statement p += 5 means p = p°S.
+) tn the precedence of logical aperatons: '}OT is followed by AND.
Tre Mate ct arb 4O°d)
oF logical operators?
(0 IL! ae 0 ht. Ih
anttyien
ICSE 2007]
NICSE 2018)
1the output:
1 int = Oca POIe4,
Litem ia bed
Devleme 9 = (ob)? true fale,
Sits = 90,
chan c= eo? 2-7,
4 fot 8 = 18 jon b= 12,
hemes = (020 hae i 7 tera
De = (val « 550 < 7p 2 4,
Wf (@) val ~ 1099
() Arithmetic oper
tor
®) Relational operau
«
() Unary & Binary ari
®) Po
© Po
netic Op-raten
patfix increment and Prefix incoement
pattix decrement and
ow
Wand ip = =
5 What is the difference between
and % operator 0) = ands ~ 27 OC zon
© What will be the output of the following ces
k
ystem out p
a oe po
(©) Give the output ofthe fellow coon” BC ogy
) What isthe value of ¥ after te eancucemn?
DCSE aegy
+Y + + —y; whem ine gute
Rewrite the following program
operator
‘emt using, chee statements intend fe teary
G) String grade = (marks >~ 907 4 se ag
© commission ~ (sale > 5000) ? (sale10)/100 ;
(©) net = (salary > 10000) ? salary
© 8= (ash < cf arc <
Oc=@>
(marke >= BO “Cmti) SE Mee tony catenin ok programaning wore
[pm ete pian ge
Dah | sure Oreste
a ©) nye Crsented programming,
0.2 Meme two procedure oriented and two object oriented programening, nGnaee
. 1D Two procedure oriented languages are “OKTRAN and BASIC
9) Too thet overt laggy ae Jae ea Python
10.3 Name four basic principles of abject orien’ progammening,
D tae
(i) otymonpane
i. ation
44 principle that allows a function t0 tbe used for multiple
SF theough the process of inheritance
inherits properties from a base cass
by ae” clase and “Derived
Satie a derives! cass
06 What docs rewability mean?
rr pens ued to perform 2 task sn base cam fe St
Sle for other bype of Proc
re This feature & known as newsablity
107 State the Java concept that is implemente* throws
eA cuperciase and a subclass
eared nepacocniting exert features of cass without socuding the background
ICSE 20131,
ICSE 20161
apa a " wn bbe used as a unit ©
De ceva of ds anf wo that ty 6
jenmed 2 Encapsaiation
sation of 2 ce
cse 20171
0.9 What i Inberitance?
Jed reusability
Indeertance is an OOP
ft promo
ple according
Ans
ICSE 2018),
another ass.
snd
pneraction? Explain with ar
Ne cate of a as wien Seer =
0.10 What is data
(Ams. itis an act oF 1
‘of ts iemportant parts (Sing
os are only awat
For example, wile driving 2 Ce, 77% Sr aad scent. By apy on of the
. ‘ crv the mal mechanism of the
Tent! features) viz. ct
San caop the car and thnes vo
Drake of car
oe ced nt PE
.a
© heirs
reins the Pmt free se
tae ©) startin
Fen
Aber Nee cats
©) stapes
The proces by shich » cine
1) potrmonphiwem 0) int
the ste Nal oe
) date 0 ete
Whach of the fotoming: is »
(4) atmeractice
om _ AA ee
Wes of the foiomring
vem aren Uh hove
&. The proces: of restricting; the fe flow
0) chee
Which of the Sodiowinng fs
Néep Tees sme feanctia
@) Uses same of
4) him mot a
3 bee procediore oriented programming, the stress is given ox
() Date Br Function (©) Obpect ) Cee
2 Cpe cam commamicate with cach other Guongh fyi oo: lie
tented pregame, Lamy
cone {0 mophan,
2 Ung 2 fection for meitipte operations ix catiea [8 414 rn
« Pots DLSVON 6 0 1.0 pecsenting ‘cates without inchaing
a ae
«bdo promotes the reumabiity tent, in abet remand
oremMSA
SES ait
- SPL 2 i
At AOE
aIn thas way real world objects and software objects are int
Why is a class called
Glass is the proto
type Hence, a clas j
ICSE 20134
Write a java statement to create am object mp of class digital
Java statement to create an object mpt «class digital
digital mp$ = new digital )on
Ane
o2
Ane.
3
Ane
os
Ans
os
Ans
Ans.
What is meant by boolean variable?
Boolean variable t 4 variable that Folds healewn
What is the difference between “t-e" and true?
true” (enciosed under double quotes) sa string Wieral wheress trae (without double
quotes) fa boolean eral
State the excape sequences for hocwontal tab and new line feed.
fal ta“ and for new fine feed ~
‘value, Le. trae or fale
Escape sexquences for hon
Is String type a primitive or non-primitive data type?
String ie a specific data tvpe that 1 framed using various character data types:
either 2 primitive nor a non primitive data type
In what way float initialisation is different from double type initialisation?
Ih heat type varie is initialised with a fractional value 2s O.0E whereas. 2 osbts
N00. The difference Between:
intialisations
For example
douiblle d-000D;
What is a variable?
Meese as a mamed memory locaina that i wed to contain a value that can RANE
Senattling on the circumctinces during the execution of 2 program.
Differentiate between pure and impure type expressions
A pure expr tas the ‘dre came data type whereas, an impure
eetsion contains elements of diferent data types
What is meant by type conversion How is
cexplist conversion?
on. the result needs to be obtained in a single speciic data
In @ mixed mode exp
type: Hence, the data type
18 Known as type conversion.
In an implicit ype conversion, the result of a mixed mode expression i obtsined
the higher most data type of the
For example, int a; float b; float c
c=a+b:
In case of explicit type conversion, the
choice and requirement
For example, int a; oat b; dow
b= oatya * 0:
averted to a required type. This process of conversion
ec
Give one example cach of a primitive data type and 2 composite data type.
type: im. Bloat, double, long, chat, etc. (amy one)
Examples of prim:
ay, class, interface, etc (amy one)
Examples of composi
State the values of n and ch.
char coh
int n=c#l
char che(chann . ACs 200
The value of
n=mu wesaosd ¢
ast
ad
020 Match the following, literals of Column A with the variables of Column
Cotame A <7
eee Pee +
bos cane
has it Seng
ass a
.« oo
002s ee
am oo on on
ou Oe
AED.
L. Multiple Choice Questions:
1 lata type occupies in the memory?
os «
om primitive data type?
ow
wr
2 Which of the following
GB String
3. Which of the following,
{or Boolean " 2) double
Which of the following ade range is applicable for lowercase letters?
“5-0 %) AF 122 5-00
ow al
atements are ‘True’ or ‘False’
whether the followi
of diferent chav acters used in a Java program. ic
L
Fe
€
There are 128 se
The ASCII codes of uppercase letters range fom 97 40 122.
‘A variable gives the exact repr station of data.
The data types int, lot, char are called non primitive types.
A Steing literal is assigned to a ‘ring, variable
2
3
“
(A character literal is always enclowed in double quotes
7 String constant can be written by using a set of alphanumeric
tharacters
An object is said to be a non-primitive data >
9. The data type int stores fractional values. é
10. Boolean type data is used to test a condition and results in
cither true or false :1. Multiple Choice Questions:
= ae Of the felhorwing, i the conmect
ook ea
2. Choose the odd one out from the following:
@> oe on
Given: String, st = (a>= 90)? “Excellent”: “Best”
Predict the output, when a = 90.
Voss () Excellent: Best
(©) Best Excetient D-Eellent
4 Chome the odd one out from the follow ng;
(@) Unary operator (@) Binary operator
(©) Ternary operator bi twee operator
B Gree xo ance + te x4--x
Find the value, when 1-5,
a= 2 on wm
State whether the following statemer
1. The precedence of operators in Java follows BODMAS.
2 The output of a++ will be 1, if int 2
3. The relational operators always resull in terms of
4. Giver: int m=5; m™=5 then the valu J in m result
5. The statement (a-bMlela>c) une
6 W int 227, A, 0; then ¢ = aby resets im 3.
7. The statement p += 5 means p = p°S.
+) tn the precedence of logical aperatons: '}OT is followed by AND.
Tre Mate ct arb 4O°d)
oF logical operators?
(0 IL! ae 0 ht. Ih
anttyien
ICSE 2007]
NICSE 2018)
1Se = (val « 550 < IOP 20 a,
Wf @) val ~ 1099
(@) Arithunetic operation
®) Relational operair
«
@) Unary de Binary arithmetic og--rator
©) Posttix increment and Pretix tncormaene
(©) Posttix decrement
@ (= y and Kp ==
What is the difference between
d % operator
What will be the outy
k
0) Hint ¥ =10 then find int 2 = (oeyripes + sy
(0) Give the output of the followig expocmtan
See Ont + 240+ +o: wena h
@) What is the value of y ater the: execution?
Yen +9y + 9 + 9: when int pute
serie the following program seyment wing i-cse atcements inated of the ternary
operator
OF cnt Fade = (marks >= S057 A”: (mar om Bayo “ar cs
©) commision = (sale > S000) ? (sake"10)/100
(©) net = (salary > 10000) ? salary
@ 8= (asd < cf asc <
emu >