Page | 1
ICS COMPUTER SCIENCE CHAPTER-1+2 PART -2 Important Question Question for ICS Computer Science Science Part-2 Chapter-01+ 02(Data Basics + Basic concepts and Te Terminoloies rminoloies of Data!ases" Q-1: Chose the correct option. 1
1x14=14 The process of arranging data in a logical sequence is called. Sorting
"
Summarizing
# collection of related fields is $ile %ecord
ata capturing
classif!ing
ata&ase
'one
(
)*S stands for: ata &usiness *anagement ser+ices
4
ata&ase ata&ase ata &usiness modeling *anagement model s!stem s!stem S!stem ,hich of the folloing is handled &! *S/ ata integrit!
ata securit!
ata independence The maor components of *S is called
#ll
ata&ase manager SQ3 is a n5 6nstructured language
$ile manager
ata manager
#ll
Structured language
7&ect oriented programming
Softare
0
2
8
# stands for:
9
ata&ase ata &asic ata&ase ata&ase authorit! administrator #dministration #pplication # primar! e! that consists of more than one attri&ute is called a: $oreign e!
<
Composite e!
11
;lo&al e!
,hich of the folloing descri&es the primar! e!/ t must &e unique
1>
*ultimedia e!
t helps in indexing of a large data&ase #n attri&ute is also non as :
t maes sorting quicer
#ll
Ta&le
%o
$ield
%elationship
#ttri&ute
%elation
# relation is also non as: Ta&le
Tuple
The Royal College & Computer Institute Feroza
Page | 2
1"
SQ3 is used for: ata definition
ata manipulation
ata definition and manipulation
Searching records
1(
#n index can &e used to:
14
mpro+e the ocument the performance structure of the of the data&ase itself data&ase # e! that is used strictl! for data
%educe data #ll dependence! for application program retrie+al purposes:
Secondar! e!
Composite e!
Candidate e!
Q-2: Write short answers any TEN, each question carry 2 marks. i. e!ne ata"ase. ii. Who is #ata a#ministrator$ iii. What you know a"out %orei&n key key.. i'.. i' e!ne (an#i#ate key ) a*ternate key$ '. What is +rima +rimary ry key key.. 'i. Write the names o% #ierent keys which use in #ata"ase, 'ii. What is entity$ i'e an exam+*e. 'iii. What is secon#ary key$ ix. Write a#'anta&es o% /. x. e!ne consistency constraints$ xi. What is /$ xii. escri"e ata mani+u*ation. xiii. e!ne ata +rocessin&.
)rimar! e!
2x10=20
Q-: Write #etai* answers o% the %o**owin& questions. 2x=13 i. What is a key$ escri"e #ierent ty+es o% keys use# in #ata"ases. ii. What is /$ /rie4y #escri"e the a#'anta&es an# #isa#'anta&es o% /.
ICS Computer Science Chapter-3 part-2 BISE Important Question Question for ICS Computer Science Science Part-2 Chapter-0# (Data!ase Desin Process" 1.
2.
Data stored data single site is in ____________ database model. In Centralized database system, all the data is stored at a single site. Design Centralized Partitionized Storage In ERD model, the relationship beteen to entities is
The Royal College & Computer Institute Feroza
Page | !
!.
-.
0.
3. 5. 9. :. 1;.
12.
1!.
1-.
represented by a" Diamond Re#tang$lar &'al symbol (ine Symbol bo% ) data model is ) logi#al Shon as an rans*ormed )ll representation entity+ into tables and o* the str$#t$re relationship relationship o* the database diagram )n Inde% may be #reated on" Primary ey Se#ondary /oreign ey )ll ey hi#h o* the *olloing is $sed to asso#iate entities ith one another Entity )ttrib$te Relationship Identi*ier ) relationship #an be" &ne to &ne &ne to many 4any to many )ll In an E+R diagram, a re#tangle represents a 6n7 Entity )ttrib$te Relationship 8one hi#h o* the *olloing are basi# data distrib$tion strategies Centralized Partitioned Repli#ation )ll hi#h o* the *olloing represent the entities ea#her St$dent Prin#ipal )ll ) te#hni<$e *or physi#ally arranging the re#ords o* a *ile on se#ondary storage de'i#es is #alled" Physi#al /ile Retrie'al =pdate pointer organization program Program hi#h o* the *olloing is related to 4odality &ptional 4andatory =nidire#tional ) and > hi#h o* the *olloing is an e%ample o* one to one relationship 4other+ >i?e+Re#ord St$dent+ Client+ da$ghter Reg8o phone+no ) relationship beteen #o$ntries and #apitals is an e%ample o* ___________ relationship. &ne to many &ne to &ne 4any to many 4any to one ____________ are the basis o* $sage paterns o* the database. Data 'ol$me and =sage analysis are $sed to estimate the size or 'ol$me and the $sage patterns o* the database. De#ision 8ormalize =sage (ogi#al ables Relations )nalysis Design
Q-"" rite short ansers any E8, ea#h <$estion #arry 2 mar?s.
i. ii. iii. i'. '. 'i. 'ii.
2%1;@2;
De*ine ma%im$m #ardinality and minim$m #ardinality. Disting$ish beteen an entity #lass and an entity instan#e. De*ine Database integrity. (ist maAor inp$ts to physi#al design. State the p$rpose o* Database design pro#ess. rite the $se o* ER Diagram. hat is the p$rpose o* *easibility st$dy
The Royal College & Computer Institute Feroza
Page | -
'iii. i%. %.
hy is re<$irement analysis #ond$#ted De*ine an )ttrib$te ith e%ample. De*ine modality.
B+!" rite detail ansers o* the *olloing <$estions. i. E%plain di**erent #omponents o* logi#al model in detail. ii. >rie*ly des#ribe basi# data distrib$tion strategies.
2%9@13
ICS Computer Science Chapter-4 part-2 BISE Important Question for ICS Computer Science Part-2$ important notes for ICS computer Science for all Boards and %ederal Board& Chapter-0'(Data Interit and )ormali*ation" Red$ndan#y in table #an #reate #ertain ____________ in the partial *$n#tional dependen#y. )nomalies Possibilities Integrity ies 2.
he attrib$tes in to di**erent tables ha'ing the same name are #alled ____________ . )#ronym Integrity omonym Independent
!.
8ormalization is the pro#ess o* #on'erting #omple% data str$#t$res into ____________ . 8e$ral Data &peration )##ess Data Stable Data Str$#t$re Data Str$#t$re Str$#t$res Str$#t$re ____________ is #reated hen to di**erent names are $sed *or the same in*ormation. E%pression Synonyms Consistent 4$t$ally Prote#ted ____________ is the pro#ess o* #on'erting #omple% data str$#t$res into simple data str$#t$res. Corre#tnes /ilter /a#t 8ormalizatio s n hi#h o* the *olloing states that no attrib$te o* a primary ?ey sho$ld #ontain n$ll 'al$e Red$ndant ransiti'e Data Se#$rity Entity In*ormation dependen#y Integrity o or more attrib$tes ha'ing di**erent names b$t same meaning are #alled" omonyms )liases Synonyms )lternae attrib$te 28/, hi#h *orm o* dependen#y is remo'ed
-.
0.
3.
5.
9.
/$n#tional
Partial
)sso#iati'e
ransiti'e
The Royal College & Computer Institute Feroza
Page | 0
:.
hi#h o* the *olloing anomalies res$lt *rom a transiti'e dependen#y Insertion 4o*i*i#atin Deletion )ll
1;.
) relation that #ontains minimal red$nden#y and allos easy $se is #alled" Clean Simple Comple% ell Str$#t$red hen all the non ?ey attrib$tes are *$lly dependent on primary ?ey then the state is ?non as ____________ . Entity /o$rth Se#ond /$n#tional Integrity 8ormal /orm 8ormal /orm Dependen#y ) relation R #an be in ____________ i* all $nderlying domains #ontains atomi# 'al$es. /o$rth /irst 8ormal Re*erential Consistent 8ormal /orm Integrity 8ormal /orm /orm ____________ m$st re*er to the P in another table or it m$st be n$ll. Red$ndant Simple Data ransiti'e Re*rential In*ormation str$#t$re dependen#y Integrity hi#h o* the *olloing states that no attrib$te o* a primary ?ey sho$ld #ontain n$ll 'al$e Red$ndant ransiti'e Data Se#$rity Entity In*ormation dependen#y Integrity
11.
12.
1!.
1-.
The Royal College & Computer Institute Feroza
Page | 3
Q-2: Write short answers any TEN, each question carry 2 marks. 2x10=20 i. Write the names o% three ty+ica* +ro"*em in mer&in& re*ations. ii. (om+are norma* %orm an# norma*i5ation. iii. escri"e transiti'e #e+en#ency. i'. ierentiate "etween +artia* #e+en#ency an# transiti'e #e+en#ency. '. What is +artia* #e+en#ency$ 'i. What are the #ata"ase anoma*ies$ 'ii. escri"e re+eatin& &rou+. 'iii. e!ne %unctiona* #e+en#ency. ix. e!ne Norma*i5ation. x. e!ne mutua* exc*usi'eness o% #ata. xi. e!ne the term o% re#un#ancy. xii. What is meant "y entity inte&rity$ xiii. e!ne re%erentia* inte&rity. xi'. 6ow is entity inte&rity attaine#.
Q-: Write #etai* answers o% the %o**owin& questions. i. What is %unctiona* #e+en#ency$ Ex+*ain with exam+*e. ii. 7++*y !rst norma* %orm on this ta"*e. e+t8No e+t8Nam Em+8no Em+8Nam e e 20 tichin& 01 9a'i# 02 /i*a* 0 inance 10 7*i 11 7"#a* 10 ana&eme 12 ;han nt 1
7si%
2x=13
ICS Computer Science Chapter-5 part-2 BISE Important Question for ICS Computer Science Part-2$ Important notes for ICS computer Science for all Boards and %ederal Board&
Chapter-0(Introduction to ,icrosoft ccess" 1
hi#h o* the *olloing is the #orre#t asso#iation /ile @ #ol$mn
2
Re#ord @ ro
/ield @ ro
Re#or d@ table ) #olle#tion o* data that #onsists o* name, address and email o* a person is #alled" The Royal College & Computer
Institute Feroza
Page | 5
Chara#t /ield er he smallest meaning*$l $nit o* data in a database is #alled"
!
>yte
Re#ord
>yte
Re#ord
-
Chara#t /ield er Ea#h separate pie#e o* in*ormation stored in a re#ord is #alled a" /orm /ield able Cell
0
) report may be based on a able
3
B$ery
>oth a and b
8one
)t most three tables
8one
/ield
Cell
) database may #ontain" &nly one table
5
)t most to tables
he #oml$mn o* a table #orresponded to" able
9
Re#ord
) database #onsists o* 'ario$s #omponents #alled" ools
:
Properties
Entities
&bAe#t s
Report
B$ery
he o$tp$t o* the <$ery is in the *orm o* a able
1;
/orm
) report is a #omplete set o* _________ *ield" Distint
Related
Designe d
1 )n 4S a##ess table #ontains" 1 Re#ords b$t no /ields b$t no re#ords *ields
12
1!
1-
)ll
>oth re#ords and *ields hi#h o* the *olloing is 8& a database obAe#t"
8one o* these
able
4S ord
B$ery
Report
hi#h o* the *olloing are obAe#ts in an 4S )##ess database" able, *orms, Database,datasheet a /olders )ll o* <$eries and nd *orms 'ies and these reports tools hi#h option in 4S )##ess is $sed to #reate a ne database *rom s#rat#h" The Royal College & Computer
Institute Feroza
Page | 9
)##ess templat >lan? database e
E%isting databas e
8e *older
The Royal College & Computer Institute Feroza
Page | :
Q-"" rite short ansers any E8, ea#h <$estion #arry 2 mar?s.
i. ii. iii. i'. '. 'i. 'ii. 'iii. i%. %. %i. %ii. %iii.
2%1;@2;
o does a database is di**er *rom a table hat is 4S )##ess (ist some disad'antages o* IDE. De*ine IDE. De*ine 4en$ >ar. hat is database izard hy Reports are important De*ine *orm. hat are reports De*ine <$ery. De*ine any to database obAe#ts. hat is database obAe#t (ist some ad'antages o* IDE.
B+!" rite detail ansers any 2 o* the *olloing <$estions.
2%9@13
•
hat is an IDE Dis#$ss its ad'antages and disad'antages.
9
•
hat is database obAe#t Dis#$ss the database obAe#ts $sed to store and retrie'e data 9
•
Des#ribe /orm and Report. Dis#$ss their ad'antages and disad'antages.
9
ICS Computer Science Chapter-6 part-2 BISE Important Question for ICS Computer Science Part-2$ important notes for ICS computer Science for all Boards and %ederal Board& Chapter-0.(Ta!le and Quer" 1
) one+to+many relationship is #reated thro$gh" 8e Relationship Relationshi Relationships Relationship Design ps izard indo s Command Command hi#h symbol is pla#ed aro$nd dates in #riterion F G 67 H hi#h ro in Design grid determines the re#ords sele#ted in <$ery" Sho Criteria /ield Sort he res$lt o* a <$ery are displayed in a" /orm
Design grid
Report
Dynaset
The Royal College & Computer Institute Feroza
Page | 1;
he graphi#al <$ery tool is ?non as" B$ery grid Design grid B$ery *orm Design *orm hi#h o* the *olloing is 8& *o$nd in totals *$n#tion in <$ery I* )'erage S$m ro$p by hi#h <$ery is $sed to Aoin to tables /I8D /I8D CR&SS)>( SE(C =84)CE D=P(IC)E E D S hi#h type o* relationship is most #ommon &ne to 4any to &ne to &ne 4any to &ne 4any 4any hi#h symbol is $sed at the end o* Aoin the line in a related table to signi*y JmanyK side o* a one to many relationship H 4 L G hat is M to ) order #alled" )s#ending 1 1
ool
ie 4en$
8$mber
yperlin?
&(E
De*a$lt 'al$e
)ll
/ield properties determine" /ield size
1-
/ile 4en$
hi#h *ield type #an be inde%ed 4emo
1!
Condes#endi )lphabeti#al ng
/ind and repla#e #ommand is *o$nd in" Edit 4en$
12
Des#ending
Inp$t mas?
o many types o* relationship #an be $sed 2
!
-
0
The Royal College & Computer Institute Feroza
Page | 11
Q-"" rite short ansers any E8, ea#h <$estion #arry 2 mar?s.
2%1;@2;
i. o are re#ords sorted in a <$ery ii. (ist some ad'antages o* <$eries. iii. De*ine re*erential integrity is $sed i'. (ist o$t the types o* relationships. '. De*ine sorting. 'i. Des#ribe the term #as#ade $pdate. 'ii. rite di**erent options in /ind and Repla#e dialog bo%. 'iii. hat is the $se o* inp$t mas? i%. hat are *ield 'alidation r$les %. rite the $ses o* design 'ie in 4S )##ess. %i. De*ine the term table in Database. %ii. hat is degree o* relation. %iii. De*ine the term #ardinality. B+!" rite detail ansers any 2 *rom the *olloing <$estions.
2%9@13
•
hat is table rite detail abo$t di**erent parts o* a table.
•
De*ine Primary ?ey. hat is the pro#ed$re o* applying primary ?ey in 4S )##ess
•
hat is relationship E%plain the pro#ed$re o* de*ining relationship in 4S )##ess.
ICS Computer Science Chapter-07(Ms Access Forms an !eports" part-2 Important Question for ICS Computer Science Part-2$ Important notes for ICS computer Science for all Boards and %ederal Board&
Chapter-0/(,s ccess %orms and eports" Q-"" rite short ansers any E8, ea#h <$estion #arry 2 mar?s.
i. ii. iii. i'. '. 'i. 'ii. 'iii. i%. %. %i.
2%1;@2;
De*ine *orm. rite some $ses o* *orm. (ist types o* *orms in 4s )##ess. rite the $se o* datasheet *orm. rite the $se o* #ombobo%. Des#ribe s$b *orm. (ist some standard types o* reports in 4S )##ess. hat is lin?ing Di**erentiate beteen *orm and report. hi#h to database obAe#t #an be $sed to #reate a report rite the $se o* sit#hboard.
B+!" rite detail ansers any 2 *rom the *olloing <$estions.
2%9@13
The Royal College & Computer Institute Feroza
Page | 12
•
.hat is lin?ing o #an an obAe#t *rom other database be lin?ed in 4S )##ess.
•
E%plain the pro#ed$re o* #reating a s$b*orm $sing s$b*orm izard.
•
hat is #onditional *ormatting E%plain ith e%ample.
•
hat is *orm E%plain its $ses and ad'antages.
•
Dis#$ss di**erent options *or editing *orms in 4S )##ess.
ICS Computer Science Chapter-0#($ettin% Starte &ith C" part-2 Important Question for ICS Computer Science Part-2$ Important notes for ICS computer Science for all Boards and %ederal Board&
Chapter-0(ettin Started 3ith C" 1
C lang$age as de'eloped in the year" 1:3:+5;
1:30+50
1:52+99
1:00+05
C as de'eloped byNNNNNNN.." on+ Dr. )bd$l Charles Denis 8e$mann Slam >abbage Rit#hie C lang$age is a igh le'el (o le'el )ssembly 4a#hine lang$age lang$age lang$age lang$age hi#h o* the *olloing lang$age pro'ided the basis *or the de'elopment o* C > COO )) P)SC)( )n IDE stands *or" Integrated de'elopmen Inp$t data Inp$t Data Internal Dis? t error en'ironment error En'ironment hat does the H sign indi#ate in an instr$#tion o* C lang$age Instr$#tion Instr$#tion Instr$#tion *or Instr$#tion *or *or *or $ser lin?er #ompiler programmer Comp$ter programs are also ?non as" So*tare Pro#ed$re ardare )lgorithm hi#h one o* the *olloing translates so$r#e #ode to obAe#t #ode as a hole The Royal College & Computer Institute Feroza
Page | 1!
Interpreter Compiler Deb$gger (in?er hi#h o* the *olloing lang$age is ideal to rite b$siness appli#ation )ssembly C&>&( >)SIC 8one lang$age )n assembly lang$age $ses" English 4nemoni# >inary digit 8one ords #odes 11 ) programQs synta% errors is dete#ted by"
12
1!
1-
Compiler (in?er (oader Deb$gger ) set o* r$les that m$st be *olloed to de'elop a program is #alled" Synta% Prepro#essor >$g Deb$g SDI& stands *or" Standard Symboli# Simple inp$t inp$t o$tp$t inp$t o$tp$t o$tp$t he e%tension o* &bAe#t *ile is"
String inp$t o$tp$t
.#
.h
.t%t
.obA
The Royal College & Computer Institute Feroza
Page | 1-
Q-"" rite short ansers any E8, ea#h <$estion #arry 2 mar?s.
2%1;@2;
i. hat do yo$ mean by delimiters ii. hy is logi#al error the most di**i#$lt error iii. hat is di**eren#e beteen b$g and deb$g i'. /ind o$t synta% error in *olloing program. In#l$de #onio.h &ID main 67 Print* 6ello7 T '. hat are header *iles 'i. 8ame di**erent types o* prepro#essor dire#ti'es. 'ii. rite short#$t ?ey to #ompile C program. 'iii. De*ine obAe#t #ode. i%. hat is #ompiler %. Di**erentiate beteen #ompiler and interpreter. %i. De*ine assembly lang$age. %ii. hat is a programmer %iii. hat is )8SI in C %i'. hat is or?ing o* this *$n#tion get#h 67 in C lang$age. B+!" rite detail ansers any 2 *rom the *olloing <$estions.
2%9@13
•
o many types o* error in C lang$age rite in detail also dis#$s hi#h one error is di**i#$lt to *ind.
•
hat ne#essary steps are ta?en to prepare a C program *or e%e#$tion
•
Des#ribe lang$age pro#essors or translators and their $ses in detail.
ICS #omp$ter model paper, ICS #omp$ter s#ien#e g$ess papers 2;1-
ICS Computer Science Chapter-0' Eements o) C an%ua%e part-2 BISE Important Question for ICS Computer Science Part-2$ Important notes for ICS computer Science for all Boards and %ederal Board&
Chapter-04(5lements of C lanuae" 1
hi#h o* the *olloing has the highest pre#eden#e OO
UU
||
++
hi#h operator is $sed to represent e<$ality in C lang$age @
@@
8one
hi#h o* the *olloing is #alled the mod$l$s operator
The Royal College & Computer Institute Feroza
Page | 10
G
V
O
U
Data type int #ontains types" 1; 2 13 hi#h is the name *or a ord that has a spe#i*i# meaning in C eyords Comments o?en &perators o add a 'al$e 1 to 'ariable y, yo$ rite" y O @1W
y @ yO 1W
y @1 O yW
)ll
he e%pression ;V- has a 'al$e e<$al to" !
0
;
8one
he 'al$e o* the C e%pression 1! O 21 V - X 2 is" ; 12 13 1hi#h o* the *olloing are 'alid e%amples o* #hara#ter #onstant Y)Q Y:Q YZQ )ll hi#h o* the *olloing data types is most appropriate *or storing a name /loat Integer Char 8one 11
ariables are #reated in" R)4
12
1-
ard Dis?
8one
a @aOb
b@bOa
a O @ b is e<$alent to" bO@a
1!
R&4 a @ Ob
hi#h is n$meri# data type /loating Integer >oth a and b 8one point he n$mber o* bytes $sed by *loat data type in C is" 2
-
12
13
The Royal College & Computer Institute Feroza
Page | 13
Q-"" rite short ansers any E8, ea#h <$estion #arry 2 mar?s.
i. ii. iii. i'. '. 'i. 'ii. 'iii. i%. %. %i. %ii. %iii.
2%1;@2;
hat is the data type o* an e%pression De*ine #omments in C lang$age (ist di**erent types o* operators in C lang$age. hat is the $se o* )8D operator hat is #ompo$nd #ondition hat is the $se o* de#rement operator in C lang$age De*ine pre*i% and post*i% in#rement operator. hy does #an#elation error o##$r o does an arithmeti# $nder*lo o##$r De*ine #onstant. hat is 'ariable initialization De*ine di**erent types o* identi*iers in C lang$age. hat is an identi*ier, e%plain ith e%ample.
B+!" rite detail ansers any 2 *rom the *olloing <$estions.
2%9@13
•
hat are logi#al operators Dis#$ss di**erent logi#al operators in C lang$age.
•
Des#ribe the #on#ept o* o'er*lo and $nder*lo ith e%amples.
•
rite don the r$les *or naming 'ariables in C lang$age ith e%amples.
ICS Computer Science Chapter-*0 Input an output Important B$estion *or ICS Comp$ter S#ien#e Part+2, Important notes *or ICS #omp$ter S#ien#e *or all >oards and /ederal >oard.
Chapter-10(Input and output"
1
hi#h o* the *olloing is not a 'alid es#ape #ode [t [r [y [* hi#h #hara#ter signi*ies the beginning o* an es#ape se<$en#e \ [ ]] ] V* is $sed *or Do$ble /loat Integer Short et#h67 stands *or o i'e et #hara#ter )ll o* these #hara#ter #hara#ter )n ampersand be*ore the name o* a 'ariable denotes )#t$al ariable )ddress Data ype 'al$e name The Royal College & Computer
Institute Feroza
Page | 15
11
12 1! 1-
he general *orm o* *ormat spe#i*ier *or the *loating point 'al$e" Vm.n* m.nV mV.n* m.nV* hi#h o* the *olloing is 8& legal element o* #ontrol string in print* statementK &rdinary Es#ape /ormat ariables #hara#ters se<$en#e spe#i*ier hi#h o* the *olloing *ormat sper#i*ier $sed *or string V* Vd V# Vs /ormat spe#i*ier is started ith symbol V U 8one hi#h o* the *olloing is displayed by print* *$n#tion Constant or e%t 'al$es o* ) and > 8one 'ariables he *ormat spe#i*ier V$ is $sed *or" =nsigned =nsigned Integer =nsigned *loat short long int hi#h o* the *olloing is an inp$t *$n#tion" s#an* print* s
#onio.h
string.h
math.h
The Royal College & Computer Institute Feroza
Page | 19
Q-"" rite short ansers any E8, ea#h <$estion #arry 2 mar?s.
2%1;@2;
i. Di**erentiate beteen print* and s#an* *$n#tions. ii. Di**erentiate beteen gets and p$ts *$n#tions. iii. rite o$tp$t o* the *olloing program. Char ord1, ord2, ord!W or1@ Y)QW ord2@ Y>QW ord!@ YCQW Print*6JV# V# ord!K, ord1, ord27W i'. rite a C statement to print the 'al$e o* $nsigned long y. '. (ist o$t the names o* di**erent *$n#tions $sed *or #hara#ter inp$t. 'i. E%plain J#ls#rK. 'ii. E%plain Jget#hK. 'iii. (ist o$t di**erent types o* *ormat spe#i*iers. i%. hi#h symbol is $sed to start *ormat spe#i*iers %. (ist some important *$n#tions *or inp$t. %i. De*ine standard inp$t. %ii. hat is #ontrol string in print* *$n#tions %iii. State the p$rpose o* Vd *ormat spe#i*ier. B+!" rite detail ansers any 2 *rom the *olloing <$estions. •
De*ine and e%plain ith e%ample Jprint*K and Js#an*K.
•
rite programs. 2%-@9
2%9@13 1%9@9
6a7 rite a program that displays a'erage mar?s $sing *ield idth o* 0 #hara#ters and pre#ision o* 2 #hara#ters, 6b7 rite a program that displays the )SCII #ode o* the #hara#ter typed by the $ser.
ICS Computer Science Chapter-** +ecision Constructs Important Question for ICS Computer Science Part-2, Important notes for ICS computer Science for all Boards and Federal Board.
Chapter-11(Decision Constructs) 1
If x = 10 and = !, "#at "ill t#e output of t#e follo"in$ expression% x & % x ' ( x ) * ! 10 1! !0 Conditional operator is an alternati+e of( If If-else ested if one #ic# of t#e follo"in$ is used for main$ t"o "a decision( If-else If ested if S"itc#
The Royal College & Computer Institute Feroza
Page | 1:
Conditional operator taes( /#ree /"o ne operands operands operands /#e case loc ends "it#(
one
nd Select
else
nd Case
rea*
In if statement, true is represented ( 0 1 2 3 #ic# of t#e follo"in$ statements is t#e simplest form of a decision structure% If /r4 catc#4 Select4.case ested if statement finall #en a relational expression is false,it #as t#e +alue 444 . 5ero ne 6ess t#an 0 one #ic# pro$rammin$ structure executes pro$ram statements in order% 7elation 8ecision Se9uence 7epetition :not#er term for a computer main$ a decision is( Se9uential
Selection
7epetition
Iteration
11 7elational operators allo" ou to 44 numers. Compare
:dd
;ultipl
8i+ide
12
#ic# of t#e follo"in$ is e9ualent to
13
p>9 ?9 p&9 ?p>9 #ic# of t#e follo"in$ are +alid case statements in a s"itc#% case 1( case x>@( case Aa* case 1.!(
1@
In statement, false is represented ( 0
1
2
3
The Royal College & Computer Institute Feroza
Page | 2;
Q-2( rite s#ort ans"ers an /, eac# 9uestion carr 2 mars. i. 8efine control structure. ii. rite t#e names of control structure. iii. 8escrie tpes of selection strure. i+. 8ra" t#e flo" c#ar of if statement. +. #ic# is t#e asic control structures for "ritin$ a pro$ram% +i. #at is output of t#e follo"in$ code% if
2x10=20
printf
8escrie se9uence structure. rite t#e sntax of Dif-else statement. rite t#e alternati+e of if-else statement. # rea statement is used in a s"itc# < structure% rite t#ree ad+anta$es of s"itc# statements. xplain Dif statement.
Q-3( rite detail ans"ers an 2 from t#e follo"in$ 9uestions. 2xG=1H rite a pro$ram t#e inputs radius. It calculates area of a circle. Is user enters 1 as c#oice. It calculates circumference if t#e user enters 2 as c#oice. rite a detail note on tpes of control structure in C lan$ua$e. #at is nested Dif statements% xplain its "orin$ "it# example.
( (om+uter cience +art-2 (ha+ter-12 ?oo+ (onstructs m+ortant Question %or ( (om+uter cience @art-2, m+ortant notes %or ( com+uter cience %or a** nterme#iate /oar#s.
Chapter-12(Loop Constructs)
1
hat is the *inal 'al$e o* % a*ter e%e#$ting the *olloing #ode"
The Royal College & Computer Institute Feroza
Page | 21
*or 6int %@;W % 1;W %OO7 1;
:
;
1
hat is the 'al$e o* a a*ter e%e#$tion o* the *olloing #ode Int a @ 20W *or 6int # @;W #-W #OO7 a @ a +1W a @ a O!W 2!
2-
20
2;
he body o* hile loop ith m$ltiple statements ends ith" Right bra#?etF
Right bra#esT
Comma,
Semi #olonW
hi#h is a loop statement i*
i*+else
sit#h
8one
Semi#olon is pla#ed at the end o* #ondition in" hile loop
Do+hile loop
/or loop
)ll
Co$nter loop
8one
hile loop is also #alled" Conditional end loop loop
his means to in#rease a 'al$e by one" 4od$l$s
In#rement De#rement
8one
his statement may be $sed to stop a loopQs #$rrent iteration and begin ne%t oneW Contin$e
>rea?
erminate
8one
) *or statement #ontains three e%pressions" initialization , test, __________ .
The Royal College & Computer Institute Feroza
Page | 22
8$ll
alidation
In#rement]de#remen t
8one
) spe#ial 'al$e that mar?s the end o* a list o* inp$t data is #alled" erminal 'al$e
Sentinel 'al$e
(oop #ontrol 'al$e
Inp$t 'al$e
11 &ne e%e#$tion o* a loop is ?non as a 6n7. Cy#le
D$ration
Iteration
est
12 o many types o* loop are a'ailable in # lang$age 2
!
-
0
1! hile loop str$#t$re alays e%e#$tes at least on#e Do+hile 1-
/or
hile
8one
hi#h o* the *olloing loop is #alled #o$nter #ontrol loop /or
hile
Do hile
8one
The Royal College & Computer Institute Feroza
Page | 2!
B+2" rite short ansers i. De*ine loop. ii. rite to ad'antages o* loop. iii. De*ine JhileK loop. i'. De*ine do+hile loop. '. Des#ribe the synta% o* do+hile loop ith e%ample. 'i. Des#ribe the synta% o* J*orK loop. 'ii. hat is J*orK loop. 'iii. hat is #o$nter #ontrolled loop i%. hat is sentinel #ontrolled loop. %. De*ine sentinel 'al$e. %i. Des#ribe nested loop. %ii. De*ine in*inite loop. %iii. o many times ill the *olloing loop display J&RI)( )C)DE4^K. *or 6int i @2;W i ;W iOO7 \ print*6J)?ram >hattiK7W T B+!" rite detail ansers rite a program that $ses a hile loop to enter a n$mber *rom the $ser and then display it. he loop is terminated hen the $ser enters +1. E%plain J*orK loop E%plain its or?ing.
ICS Computer Science part-2 Chapter-*3 Functions in C Important Question for ICS Computer Science Part-2, Important notes for ICS computer Science for all Intermediate Boards.
Chapter-1#(%unctions in C"
1
) type o* *$n#tions ritten by the programmer is ?non as" =ser >$ilt in S$bprograms S$b *$n#tions de*ined *$n#tions (o#al 'ariables are also #alled" )$tomati#
8ormal
lobal
8one
) 'ariable de#laration o$tside any *$n#tion is ?non as" lobal (o#al 'ariable E%ternal Stati# The Royal College & Computer Institute Feroza
Page | 2-
'ariable
'ariable
he s#ope o* a 'ariable re*ers to its" (ength
8ame
)##essibility
Data type
he parameters in *$n#tion de#laration are #alled" /ormal )#t$al >oth ) and > 8one parameters parameters hat is the 'ariable name that is $sed by a *$n#tion to re#ei'e passed 'al$es /$n#tion Parameter E%pression Constant he *irst line o* *$n#tion de*inition is ?non as" /$n#tion /$n#tion In'o?ing a 8one header o$tp$t *$n#tion he pro#ess o* sending an arg$ment to a *$n#tion is #alled" Sending
11
12
1!
1-
/iltering
Deli'ering
Passing
In a C program, to *$n#tions #an ha'e" Same name Same name Same Same name and same b$t di**erent parameters parameters parameters /$n#tion de#laration #onsists o*" 8$mber and /$n#tion /$n#tion types o* )ll name ret$rn type parameters ) b$ilt in *$n#tion" CanQt be Can be CanQt be ret$rn Can be ret$rn rede*ine rede*ine a 'al$e a 'al$e he name o* a#t$al and *ormal parameters" 4ay or may 4$st be 4$st be in 4$st be same not be same di**erent loer #ase 4emory is allo#ated to a lo#al 'ariable at the time o* its" /irst De#laration Destr$#tion De*inition re*eren#e lobal 'ariables are #reated in" R)4
R&4
ard Dis?
Ca#he
Q-"" rite short ansers
i.
De*ine global 'ariable. The Royal College & Computer
Institute Feroza
Page | 20
ii.
Compare lo#al and global 'ariable.
iii.
De*ine lo#al 'ariable.
i'.
State the $se o* *ormal parameters.
'.
o does a *$n#tion ret$rn 'al$e
'i.
o does a *$n#tion ret$rn 'al$e
'ii.
hat is *$n#tion #all
'iii.
hat is *$n#tion de*inition
i%.
De*ine *$n#tion body.
%.
De*ine *$n#tion header.
%i.
Des#ribe b$ilt in *$n#tion.
%ii.
o does a *$n#tion ma?e programming easier
B+!" rite detail ansers •
>rie*ly e%plain the bene*its o* $sing *$n#tions.
•
rite a program that inp$ts a n$mber in main *$n#tion and passes the n$mber to a *$n#tion. he
*$n#tion displays table o* that n$mber.
The Royal College & Computer Institute Feroza