Post on 19-Jan-2021
SURA BOOKS
OCTOBER - 2016
[Time : 3 hours] XII STD COMPUTER SCIENCE (With Answers) [Marks : 150]
PART-IChoose the most appropriate answer :
[75 × 1 = 75]
1. What value is stored in the variable c, if a = 5; c = a++;a) 5 b) 6 c) 0 d) 10
2. InStarOfficeBasewhichoptionisusedtospecifyiftheusershouldalwaysenteravalueforthatfield?a) EntryRequired b) Default valuec) Lengthd) Format
3. Whichcolouredsquigglyunderlineisusedforthe words that do not match with the words in thedictionaryinStarOfficeWriter?a) Blueb) Green c) Redd) White
4. Which of the following command is used to printthepresentation?a) File → Printb) Edit → Printc) Tools→ Printd) Format → Print
5. WhichofthefollowingactasplaceholdersinthefunctionprototypeinC++?a) variables b) typedefc) character d) enumerator
6. InStarOfficeCalc,inPagestyleDialogBoxwhichCheckBoxshouldbeclickedtoprintaworksheetwithgridlines?a) Sheetb) Pagec) Grid d) Format
7. Thedefault top andbottommargins are inhowmanyinchesinStarOfficeWriter.a) 1.25 b) 0.5c) 1d) 1.5
8. Whichkeyisusedtoendthepresentation?a) Ctrl b) Altc) Deleted) Esc
9. Which is the illegal access to the network or computersystem?
a) Ethics b) Virusc) Softwared) Cracking
10.Whichcommandisusedtohideaslide?a) Tools → Show/Hide Show b) Tools → Hide Show c) Format → Hide Slide d) Slide Show → Show/Hide Slide
(1)
SURA BOOKS
2 Sura’s XII Std Computer Science 2016 – October Question Paper with Answers
11.ExpansionofGIF:
a) GraphicInformationFormatb) GraphicInterchangeFormatc) GraphicInterchangeFiled) GraphicInformationFile
12.InC++thebodyoftheclassisterminatedby:
a) : b) :: c) () d) ;13.Whichofthefollowingdisplaysthefieldsof
arecordinawell-spacedoutmanner?
a) Table b) Formc) Report d) Query
14.Which of the following function copiesSourceStringtoTargetString?
a) Stringcopy()b) Strcpy()c) Strcmp()d) Strcpy()
15.Whichoneofthefollowingiscalledtheentry-checkloopinC++?a) do..while b) whilec) continue d) break
16.Whichoneof the following is themultiplebranchingstatementinC++?a) Switch b) ifc) while d) do..while
17. In C++, which one of the following braces is usedtoenclosethebodyofaclass?
a) () b) {} c) [] d) < >
18.Which of the following is executed in theorderofinheritedclass?
a) Polymorphism
b) Destructor
c) Constructor
d) Function
19.Making and using duplicate hardware andsoftware is called :
a) Virus
b) Ethics
c) Piracy
d) Cracking20.Which is a telephonebased shared service
centerforaspecificcustomeractivities?a) Data Management b) Call Centerc) Digitizationd) Morphing
21.Whichoneofthefollowingprocesstojointhe data from more than different tables in aDatabase?
a) Sorting b) Filter
c) Searching d) Merging
22.Whichof the following is the extensionofshockwaveformat?
a) .snd b) .swf
c) .snf d) .swd23. Which of the following sign is used to make
thecelladdressabsoluteinStarOfficeCalc?
a) # b) &
c) $ d) %
24.WhichoneofthefollowinginC++ismemoryboxthatholdvaluesorconstants?
a) punctuators
b) keywords
c) constants
d) variables
SURA BOOKS
Sura’s XII Std Computer Science 2016 – October Question Paper with Answers 3
25.In C++ themechanism of giving specialmeaningtoanoperatoriscalled:
a) Function Overloading
b) OperatorOverloading
c) Constructor Overloading
d) Destructor Overloading26.Whichof thefollowingisusedtouniquely
identifyarecordinadatabasetable?
a) Field b) Record
c) File d) PrimaryKey27.InC++whichstatementwouldexitthecurrent
looponly?
a) for
b) switch
c) struct
d) break
28.WhichofthefollowingisthemostpowerfulfeatureofanObjectedOrientedProgramminglanguage?a) Class b) Abstractc) Constructor d) Inheritance
29. Which of the following is a named set of defaultsforformattingtext?
a) Style b) Formatting
c) Fonttype d) Points30.Howmanycopyof themembervariable is
createdforstaticdatamembersinC++?
a) One
b) Two
c) Three
d) Four
31.Which command is used to change the column widthofaWorksheetinStarOfficeCalc?
a) Format → Width → Column
b) Format → Column → Height
c) Format → Height → Column
d) Format → column → width32. In C++ a collection of variables of the same
typeis:
a) Function
b) Operators
c) Pointer
d) Array33.Whenaderivedclassinheritsonlyfromone
base class it is known as :
a) Single Inheritance
b) MultipleInheritance
c) Multilevel Inheritance
d) HybridInheritance34.HowmanykindsofloopsarethereinC++?
a) four b) threec) two d) five
35. In StarOffice Calc which of the following bar isused todisplay thecurrentcelland its contents?a) Function b) Objectc) Formula d) Status
36. HowmanyfieldtypesarethereinStarOfficeBase?a) 10 b) 20 c) 30 d) 40
37. In StarOfficeWriterwhichbuttonisusedtoaddthewordtothedictionary?a) Add b) Replacec) Insert d) Suggestions
SURA BOOKS
4 Sura’s XII Std Computer Science 2016 – October Question Paper with Answers
38.ExpansionofDBMS:a) DataBaseManagementSystemb) DataBaseMemorySystemc) DataBaseMemoryStoraged) DeviceBasedMemoryStorage
39. Which one of the following reduces software complexity?a) Polymorphismb) Inheritancec) Objectd) Class
40.InStarOfficeWriterwhichcommandisusedtoinsertmorethanonerowinthetable?
a) Table → Insert → Rows
b) Format → Insert → Rows
c) Tools → Insert → Rows
d) File → Rows→ Insert 41.InC++whichof the following isa special
functionthatcannotbeoverloaded?
a) Constructorb) Destructorc) Operatord) Function
42. In C++ which one of the following is used as prefixtodestructor?
a) ~ b) @ c) ! d) #
43.InC++whichofthefollowingoperatorwhenoverloaded through a member function take oneexplictargument?
a) Unary
b) Ternary
c) Binary
d) Function
44.InStarOfficeWriter,theflashingverticalbaris called :
a) Pointer
b) Operators
c) Insertion Point
d) Key45. Which one of the following is used to
constructC++basicstatements?
a) Symbols
b) Operators
c) Tokens
d) Functions46. The functions that return no value in C++ is
declared as :
a) main
b) cout
c) cin
d) void47.InStarOfficeWriterwhichcommandisused
toinsertpagenumbersineachpage?
a) Format → Fields → Page Number
b) View → Fields → Page Number
c) Tools → Insert → Page Number
d) Insert → Fields → Page Number48.Inwhichyear,RealAudio/RealVideoformat
wasdeveloped?
a) 1981 b) 1995 c) 1982 d) 199449.IntegraldatapromotioninC++ispurelywhat
oriented?a) Object b) Computerc) Calculator d) Compiler
SURA BOOKS
Sura’s XII Std Computer Science 2016 – October Question Paper with Answers 5
50.Reducing theframecount to less thanhowmanyframespersecondcausesthevideotolookjerky?
a) 40 b) 15c) 20 d) 25
51. In C++ Member functions are called :
a) Accessspecifier b) Attributesc) Methods d) Operator
52.ThenameC++wascoinedby:
a) DennisRitchieb) DanBricklinc) RickMascittid) BjarneStroustrup
53.Whickey isused tomake theselected textboldinStarOfficeWriter?
a) Ctrl+A b) Ctrl+Bc) Ctrl + C d) Ctrl + D
54.InStarOfficeImpresswhichofthefollowingcommand is used to openMedia PlayerWindow?
a) View → MediaPlayerb) Format → MediaPlayerc) Tools → MediaPlayerd) Insert → MediaPlayer
55.InC++which function execute faster butrequiremorememoryspace?
a) cinlineb) inlinec) outlined) coutline
56.WhichfunctionisusedtofindsquarerootofagivennumberinStarOfficeCalc?
a) SQUARE() b) ROOT()c) SQRT() d) SQR()
57. In C++, which one of the folowing is called scoperesolutionoperator?
a) :: b) &?c) ?: d) &
58.Whichkeyisusedtomovetheinsertionpointto the beginning of the line in StarOfficeWriterdocument?
a) Alt + Home b) Shift + Homec) Ctrl + Home d) Home
59.Whichof the followingoperator isused tocombinesectionsoftextinStarOfficeCalc?a) : b) & c) ! d) $
60. Which view allows to view miniature images ofalltheslidesinthepresentation?
a) Slide Sorter b) Normalc) Notes d) Outline
61.Thenumberofanelementinthearray int a [2] [4];
a) 4 b) 6 c) 8 d) 1262. TheFirstElectronicSpreadSheet:
a) Lotus 1 - 2 - 3 b) VisiCalcc) Excel d) Improve
63. Which of the following database consists of singledatatable?
a) Relational b) Flat-Filec) ObjectOriented d) Hierarchical
64.HowmanystoragespecifiersarethereinC++?
a) One b ) Two c) Three d) Four65.AcategoryofITenabledservicespertainingto
collection,digitizationandprocessingofdatacoming from various source is :
a) Tele - Medicine b) Website Service c) e - Governance d) Data Management
SURA BOOKS
6 Sura’s XII Std Computer Science 2016 – October Question Paper with Answers
66. Information is :a) Set of Processed Constant b) Set of Processed Datac) SetofprocessedCommandd) SetofProcessedOperator
67.InC++whichofthefollowingoperatorisusedtoaccessthemembersofaclass?a) dot (.) b) Semicolon (;)c) Comma(,) d) Colon (:)
68.InC++whichaccessspecifierisusedtoaccessthemembersonlyfromwithintheclass?a) Private b) Protectedc) Public d) Static
69.Whichisthetechniqueofdistortingasingleimagetorepresentsomethingelse?a) Morphing b) Animatingc) Modeling d) Warping
70.Whichofthefollowingfunctiongetsexecutedwhenaninstanceofaclasscomesintoscope?
a) Method b) Argumentsc) Destructor d) Constructor
71.InC++whichfunctionremovesthememoryof an object whichwas allocated by theconstructor?
a) Pointer b) Destructor c) CopyConstructor d) Modifier72.ExpansionofCBT:
a) CommonBusinessToolb) CalculatorBasedToolsc) ComputerBasedTutorialsd) ComputerBasedTools
73.In StarOffice Base, each row in a tablerepresents:
a) File b) Fieldc) Record d) Data
74.WhichpermitsbankingfromthecomfortofthehomebyusingInternetfacilities?
a) e-Learning b) e-Shoppingc) e-Banking d) e-Governance
75. Which one of the following increases the functionality of a derived class andpromoreusabilityofthebaseclass?
a) Encapsulationb) Inheritancec) Polymorphismd) Object
PART-II
Answer any twenty questionsinone or two sentences each : [20 × 2 = 40]
76.Whatistextediting?
77.Whatismeantbyautospellcheckicon?
78.Canwechangethedatapresentinacell?Ifso,how?
79.ListthetypeofcellreferencinginStarOfficeCalc.
80.WhatisPrimaryKey?Giveexample.
81.Whatisform?
82. What is Compression?Explainthetypes.
83. Write short note on MIDI format.
84. How to inser t and de le te s l ide in Presentation?
85. How to start custom sl ide show in Presentation?
86.DefineObject?
SURA BOOKS
Sura’s XII Std Computer Science 2016 – October Question Paper with Answers 7
87.WritenoteonconditionaloperatorinC++.
88.Writeabouttypedefwthexample.
89.WritedowntheimpactofmodifiersinC++?
90. Write note on nested if statement.
91.Whatare thetypesofscopeofvariables inC++?
92.Writeshortnoteonstrlen()withexample.
93.WhatisMatrix?
94.DefineClass.
95. Write note on (1) Data Members (2) Member functions.
96.Whatismeantbyoperatoroverloading?.
97.Whatarethefunctionsofconstructor?
98.Listthetypesofinheritance.
99. Write note on e - Governance.
100.WhatisVirus?
PART-III
Answer any seven questions. [7 × 5 = 35]
101.Write the steps involved in search andreplacingagiventextinStarOfficeWriter.
102.In StarOfficeWriterwhat are the variousfunctions of the icons in the table formatting toolbar?
103.ExplainhowtoinsertobjectsinStarOfficeCalc.
104. List the advantages of using electronic spreadsheet.
105.Explainthetypesofdatabases.
106.ExplainloopswithsuitableexampleinC++.
107.Explain inline function with suitableexample.
108.Definefunctionoverloading.Listtherulesof function overloading.
109.DebugthefollowingC++programtogetthefollowingoutput:
output 3 4 5Program :# include (iostream. h)# include < conio.h >class A{ public; int a1,a2:a3; Void getdata[] { a1=3; a2=3;a3=5; }}ClassB::publicA(){ PUBLIC void func() {
SURA BOOKS
8 Sura’s XII Std Computer Science 2016 – October Question Paper with Answers
int b1:b2:b3; A::getdata[]; b1=a1; b2=a2; a3=a3; cout<<b1<<'\t'<<b2<<'\t'<<b3; }void main(){ clrscr(); Bder; der1:func(); getch();}
110.Find the output for the following C++program.#include<iostream. h>#include<conio.h>classsample
{
private:
int a, b;
public:
sample()
{
a=b=0;
cout<<"\nConstructor of class sample";
}
~sample()
cout<<"\nDestructorofclasssample";
}
void assign()
{
a=25;
b=85;
}
voiddisplay()
{
cout<<"\nThe two integers are"
<<a<<'\t'<<b;
cout<<"\nThe sum of integers"<<a+b;
}
};
void main()
{
sampleobj;
cout<<"\nObject";
obj.assign();
obj.display();
}
]]]]
SURA BOOKS
Sura’s XII Std Computer Science 2016 – October Question Paper with Answers 9
AnswersPART - I
1. (a); 2. (a); 3. (c); 4. (a); 5. (a); 6. (b); 7. (c); 8. (d); 9. (b); 10. (d);
11. (b); 12. (d); 13. (b); 14. (b); 15. (a); 16. (a); 17 . (b); 18. (c); 19. (c); 20. (b);
21. (d); 22. (b); 23. (c); 24. (d); 25. (b); 26. (d); 27. (d); 28. (d); 29. (a); 30. (a);
31. (d); 32. (d); 33. (a); 34. (b); 35. (c); 36. (b); 37. (a); 38. (a); 39. (a); 40. (a);
41. (b); 42. (a); 43. (c); 44. (c); 45. (c); 46. (d); 47. (d); 48. (b); 49. (d); 50. (b);
51. (c); 52. (d); 53. (b); 54. (c); 55. (b); 56. (c); 57. (a); 58. (c); 59. (c); 60. (a);
61. (c); 62. (b); 63. (b); 64. (d); 65. (d); 66. (b); 67. (a); 68. (b); 69. (d); 70. (d);
71. (b); 72. (c); 73. (c); 74. (c); 75. (b).
PART -II
76. Entering a new text or modifying theexistingtextinadocumentisknownastextediting.
77. StarOfficeWriterwillautomaticallycorrectsome spellingmistakes. StarOfficeWriterrecognises some commonmisspellingsand typographical mistakes and makesthe replacement automatically using autocorrectionoption.
E.g: Ifaword is typedas ‘teh’StarOfficeWriterautomatically replaces thiswith thecorrect word ‘the’.
78. Toeditthecontentsinacellthewaysare: (i) Type in the newdata.Thenewdata
willsimplyoverwritetheoldcontentsof the cell.
(ii) Click on the formula bar with the mouse, press theF2 functionkeyorsimply double-click on the cell.Averticalcursorappearsontheformulabar. Move the cursor to the left using
theleftarrowkeyorthebackspacekeyand edit the data.
79. Thetwotypesofcellreferencingare:
(i) Relativecelladdressing,
(ii) Absolute cell addressing. 80. A primary key is a key that uniquely
identifies a record in a database table. Inrelational database, a primary key canconsistofoneormorefields.
Example : In a mark list table ‘regno’ is primary key since it uniquely identifies astudent record.
81. A form is simply a screen that displaysthe fields of a record inwell-spaced outmanner.
Formsareuserdefinedscreensthatareusedto make it easier to enter, view and edit the datainatableoraquery.
82. Compression is a technique bywhich arecurringsetofinformationisidentifiedandreplacedbyasinglepieceofinformation.
SURA BOOKS
10 Sura’s XII Std Computer Science 2016 – October Question Paper with Answers
Thetwotypesofvideocompressionsare: (i) Lossless compression: Retains
the exact image throughout thecompression.
(ii) Lossy compression: Provides a comparat ively higher ra t io ofcompressionbut results insome lossofquality.
83. The Musical Instrument Digital Interface or theMIDIformatisonethatiscommonlyusedfor transferring music information between electronicmusic devices like synthesizersandsoundcardincomputers.
84. To insert a slide, click the Slide button in the Presentation toolbar or choose Insert → Slide from the menu bar. The new slides uses the pagelayoutofthepreviousslide.
To delete a slide, select the slide, to delete in theSlidesPaneandpressDeletekeyorrightclick on the slide, and choose Delete Slide.
85. To start a custom slide show : (i) Choose Slide Show → Custom Slide
Show. (ii) Select the slide show the user want to
start from the list. (iii) Click Start. 86. Anobjectisagroupofrelatedfunctionsand
data.Anobject is a kindof self-sufficient‘sub-program’withaspecificfunctionalarea.
87. ConditionalOperator?: (num1>num2)?“true” : “else” -?: Is a ternary operator. num1 > num2,” “true”, “false”, are theoperands.Aternaryoperator(?:)isalsocalledasconditionaloperator.ThegeneralsyntaxisE1?E2:E3whereE1,E2andE3are values or statements. (for example toassignthemaximumvalueofthetwovaluesonecanexpressitas:max=(num1>num2)?num1>num2;Thevariablemaxwill takethe value of num 1 if num 1 is greater than num2,otherwisemaxwillbeassignedwiththe value of num 2.
88. Users can define a variable that would represent an existing data type. “Typedefinition” allowusers to define suchuserdefineddatatypeidentifier.
The syntax :
typedefdata_typeuser_defined_data_type_identifier;
For example:
typedefintmarks;
typedefchargrade;
89. Theimpactofmodifiers.
(i) unsigned modifies the range of the integer values as the sign bit is also used to store data.
(ii) longincreasesthebytesforaparticulardatatype, thusincreasingtherangeofvalues.
90. Nested if statement.Thestatementsequenceofiforelsemaycontainanotherifstatementi.e., the if .. else statements can be nested within one another as shown below:
In an nested if.. else statement, Each ‘else’ matches with the nearest unmatched preceding‘if”.
SURA BOOKS
Sura’s XII Std Computer Science 2016 – October Question Paper with Answers 11
91. TherearefourtypesofscopesinC++.Theyare,
i) Localscope ii) Functionscope iii) FileScope iv) Classscope
92. strlen() function is used to return the length ofthestringor-astringarray.
Eg : strlen(“school”). It returns the value 6.
93. Amatrixisasetofm×nnumbersarrangedintheformofarectangulararrayofmrowsandncolumns.Matricscanberepresentedthrough2-Darrays.
94. A class is a new way of creating andimplementingauserdefinddatatype.Classesprovideamethodforpackingtogetherdataofdifferenttypes.Aclassiswaytobindthedata and its associated functions together.
95. 1. Data members are the data variables that representthefeaturesofpropertiesofaclass.
2. Memeber functions are the functions that perform specific tasks in class.Member functions are called as methods and data members are also called as attributes.
96. The term operator overloading, refers togivingadditionalfunctionalitytothenormalC++operators like+,++,-,–,+=, -=,*.<,>.The statement sum = num1 + num2 would be interpretedasastatementmeanttoperformaddition of numbers (integer/float/double)and store the result in the variable sum.
97. Functions of constructor are: (i) The constructor function initializes the
classobject (ii) Thememoryspaceisallocatedtoan
object.
98. There are different types of inheritance.Single inheritance,multiple inheritance,multilevel inheritance, hybrid inheritanceand hierarchical inheritance.
99. Computershelpsustolookatthegovernmentwebsites and the services provided bythem.The variouswebsites provided bythe government give the details about the departments, specific functions, specialschemes, documents, contacts, links, IAS intranet,sitemap,search,what’snew,pressreleases, feedback. These websites are both in English and Tamil.
100. Avirusisaself-replicatingprogramthatcancausedamagetodataandfilesstoredonyourcomputer.These are programswritten byprogrammerswithgreatprogrammingskillswhoaremotivatedbytheneedforachallengeor to cause destruction. 57000 known virus programsareinexistence.Sixnewvirusesarefoundeachday.
PART -III
101. TheFindandReplacefeatureinStarOfficeWritertosearchforandtoreplacewordsinatextdocument.
ToFindandReplaceText
(i) Choose Edit Find&ReplaceTheFindandReplacedialogboxappears.
(ii) IntheSearchforbox,typethetextorword of a document to be searched.
(iii) In theReplacewith box, enter thereplacementwordorphrase.
(iv) Click Find to start the search.
SURA BOOKS
12 Sura’s XII Std Computer Science 2016 – October Question Paper with Answers
(v) Tofindthefirstinstanceofthewordorphrase,dooneofthefollowing:
(a) Toreplacethefoundinstanceofthe text of a document enteredin theReplacewith box, clickReplace.
(b) To replace all instances of thetextofadocumententeredintheReplacewithbox,ClickReplaceAll.
(c) To skip the found text and tocontinue the search, click Find again.
6. ClickClosetofinish the search.
102.The functions of each icon in the toolbar are :
–Table Fixed.
– Table Fixed, Proportional.
– Table Variable.
– Merge cells : This icon is used to combine two or more cells into a single cell.
– Split cells : This icons is used to splitacellintotwoormorecells.
– Optimise : Clicking on this icon displays a pop-upmenuwithoptionslikeSpacecolumnsequally, Space rows equally,Opt imum row height andOptimumColumnwidth.
– Inserting Row : This icon is used to insert a row below the current row.
– Inserting Column : This icon inserts a column to the right of the current column.
– Delete Row : This icon deletes the current row from the table.
– Delete Column : This icon deletes the current column from the table.
– Borders : This icon display afloating toolbar with different borderoptionforthetable.
– Line Style : This icon is used to choosethestyleoflinetobeusedfor the borders.
– Border Colour : Clicking on this icondisplaysapaletteofcoloursthat can be used as a border colour for the table.
103. TogetInsertObjectfloatingtoolbar,clickonViewToolbarInsertObjectoption.Itdisplayswith following icons :
1. Insert chart icon :
Thisiconisusedforpresentingthedatain the worksheet in the form of charts ofdifferentkindssuchasbarchart,piechart,lines,X-Yplot,etc.
2. Insert Formula icon :
This icon is used for inserting a formula in the worksheet for performingcalculations.
3. Insert Floating Frame icon :
This icon is used to generate a scrolling screen within a worksheet.
SURA BOOKS
Sura’s XII Std Computer Science 2016 – October Question Paper with Answers 13
4. Insert Movie and Sound icon :
This icon is used to insert sound or video filesintothecurrentworksheet.
5. Insert OLE object icon :
Thisiconisusedtoinsertobjectsfromotherapplicationintoaworksheet.
6. Insert Applet icon :
ThisiconisusedtoimportJavaAppletsinto the worksheet.
104. Anelectronicspreadsheetisaworksheetusedinacomputertocreateandquicklyperform'What if' analysis of interrelated columnardatainworkspaces.
The main advantages of using electronic spreadsheetsare:i) Calculations are automated through
thebuilt-inmathematical,financialandstatistical functions.
ii) Accurateresultstoanydesiredlevelofdecimalpointsarepossible.
iii) Worksheetscanbequitebiginsize.iv) Anypartoftheworksheetcanbeviewed
or edited.v) Worksheet can be saved and retrived
later.vi) Anypartofanexistingworksheetcan
bemergedwith any existing or newworksheet.
vii) Anypartorwholeoftheworksheetcanbeprintedinadesiredformat.
viii) Worksheet data can be viewed in the formofgraphsorcharts.
ix) The worksheet information can betransferred to any database orwordprocessingsoftware.
105. The classification of Database based on conceptualstructuresare:
(i)Flat-Filedatabase,(ii)Relationaldatabase, (iii) Hierarchical database, (iv) Network database,(v)Object-Orienteddatabase.
(i) Flat-File Database. A database file that consists of a single data table is a Flat-filedatabase.Flat-filedatabasecanbequiteuseful forcertain single-useror small-group situations, especiallyfor maintaining lists such as address lists or inventories. Data that is stored,managed, andmanipulated inspreadsheet is another example of aflat-filedatabase.
(ii) Relational database. A relational structurerepresentsadatabasemadeupof a set of related tables. In a relational database,oneormorecommonfieldsexistingintwoormoretablescreatearelationshipbetweenthesetables.Thecommonfield orfields are called theKeys.
Aprimarykey is a key that uniquelyidentifiesarecordinadatabasetable.Inrelationaldatabases,aprimarykeycanconsistofoneormorefields.
The relational database structure is themostprevalentdatabaseintoday’sbusiness organizations.
(iii) Hierarchical database. The hierarchical database structures were primarilyused onMain Frame computers. Inhierarchical database, records are
SURA BOOKS
14 Sura’s XII Std Computer Science 2016 – October Question Paper with Answers
organizedinatreelikestructurebytype.Therelationshipbetweenrecordtypesissaidtobeaparent-childrelationship,inwhichanychildtyperelatesonlytoasingleparenttype.
(iv) Network database.The Network database is very similar to thehierarchical structure except that anyonerecordtypecanrelatetoanynumberofotherrecordtypes.
(v) Object Oriented database.AnObjectOriented database is a newer structure that has been generating a greet deal of interest in recentyears.Theobjectoriented structure groups data itemsand their associated characteristics, attributesandproceduresintocomplexitems called objects. Physically anobject can be anything: a product orevent, such as house, an appliance,anartpiece,acustomercomplaint,orevenapurchase.Anobject isdefinedby its characteristics, attributes andprocedures.Anobject’scharacteristicscanbetext,sound,graphicsandvideo.Examples of attributes might becolour, size, style,quantityandprice.Aprocedurereferstotheprocessingorhandling that can be associated to the object.
106.for(;;)..loop:isanentrycontrolledloopandisusedwhenanactionistoberepeatedfor a predeterminednumber of times.Thesyntaxis
for(initial value ; test-condition ; increment)
{
action block;
}
Thegeneralworkingoffor(;;)loopis:
(i) The control variable is initialized thefirsttimewhenthecontrolenterstheloopforthefirsttime.
(ii) Test condition is evaluated.The body oftheloopisexecutedonlyiftheconditionisTRUE.Hencefor(;;)loopiscalledasentrycontrolledloop.
(iii)Onrepetitionoftheloop,thecontrolvariableisincrementedbeforethebodyoftheloopisexecuted.
(iv)Theloopisterminatedwhenthetestconditionevaluates to false.
Thefollowingprogramillustratesfor(;;)loop:
# include <iostream.h>
# include <conio.h>
void main( )
{
int i,fact = 1;
for(i = 1; i < 6; i++)
fact*=i;
cout << “\nThe factorial of the number is ..” << fact;
}
SURA BOOKS
Sura’s XII Std Computer Science 2016 – October Question Paper with Answers 15
for (i = 1; i < 6; i++)
Incrementation (1st segment)
Test condition (2nd segment)
Initialisation of control
variable (3rd segment)
(i) Initialisationisexecutedonlyonce,i.e.,whentheloopisexecutedforthefirsttime.
(ii) Test condition is evaluated before the commencementofeveryiteration.
(iii)Incrementation is evaluated and executedbefore the commencement of new iteration.
107. Callstatementtoafunctionmakesacompilerto jump to the functions and also to jumpback to the instrument following the call statement. This forces the compiler tomaintainoverheadslikeSTACKSthatwouldsavecertainspecialinstrumentspertainingtofunction call, return and its arguments. This reduces the speed of program execution.Hence under certain situations speciallywhen the functions are small (less number of instructions), the compiler replaces thefunctioncallstatementbyitsdefinitioni.e.,its code during program execution.Thisfeature is called as inlining of a function technicallycalledasinlinefunction.
Forexample,
# include <iostream.h>
# include <conio.h>
inlinefloatconvert_feet(intx)
{
returnx*12;
}
void main( )
{
clrscr( );
int inches = 45;
cout<<convert_feet(inches);
getch( );
}
108. The ability of the function to process themessage or data in more than one form is called function overloading.
Rules for function overloading are :
(i) Each overloaded function must differ either by the number of its formalparametersortheirdatatypes.
(ii) Thereturntypeofoverloadedfunctionsmayormaynotbethesamedatatype.
(iii) The default arguments of overloaded functionsarenotconsideredbytheC++compileraspartoftheparameterlist.
(iv) Do not use the same function name for two unrelated functions.
109. output
3 4 5
Program :# include <iostream. h># include < conio.h >class A{ public: int a1,a2:a3;
SURA BOOKS
16 Sura’s XII Std Computer Science 2016 – October Question Paper with Answers
]]]]
void getdata[] { a1=3; a2=3;a3=5; }}ClassB::publicA{ Public: void func() { int b1:b2:b3; A::getdata(); b1=a1; b2=a2; a3=a3;
cout<<b1<<'\n'<<b2<<'\n'<<B; }void main(){ clrscr(); Bder; der :func(); getch()}
110. Output : constructorofclasssample object The two integers are 25 85 The sum of integers 110 Destructorofclasssample.