CHow to Programdoc.docx
《CHow to Programdoc.docx》由会员分享,可在线阅读,更多相关《CHow to Programdoc.docx(21页珍藏版)》请在冰豆网上搜索。
CHowtoProgramdoc
TOUROCOLLEGECOURSESYLLABUS
LANDERCOLLEGE
DEPARTMENT:
ComputerScience
COURSETITLE:
DataStructures
COURSENUMBER:
MCO242
PREREQUISITES:
MCO232
CREDITHOURS:
3
DEVELOPER:
MiriamPlonczak
LASTUPDATE:
July2003
COURSEDESCRIPTION
ThiscourseexploresthemoreadvancedconceptsoftheObjectOrientedDesignandProgrammingparadigmincludingoperatoroverloading,inheritanceversuscomposition,polymorphism,run-timeversuscompiletimebinding,multipleinheritance,shallowversusdeepcopying,exceptionhandling,andfunctiontemplates.Inaddition,thebasicfileI/Ooperationswillbecovered.Somebasicdatastructuressuchasstacksandqueuesmaybeintroducedaswell.Studentswilldevelopapplicationsthatimplementtheseobject-orientedconceptsusingC++.
COURSE/DEPARTMENTALOBJECTIVES
Thestudentswillbeableto:
Explainwhenstaticdatamembersareusedandhow
Differentiatebetweenclassstaticdatamembersandclassdatamembers
Giveanexampleofanoverloadedoperatorandexplainhowoverloadedoperatorsareusedtomakeclassesactlikebuiltindatatypessuchasintandfloat
Developcodethatimplementsavarietyofoverloadedoperatorsforaparticularclass
Usememorymanagementtechniquessuchasdynamicmemoryallocation,releasingdynamicallyallocatedmemory
Manipulatestringsinavarietyofways:
usingcharactersarrays,usingchar*pointers,usingtheC++stringclass
Differentiatebetweenthedifferentwaysstringscanbemanipulatedandidentifytheadvantagesanddisadvantagesofeachtechnique
UseC++libraryfunctionstohandleC-stringssuchasstrlen(),strcpy(),strcat(),strcmp(),strstr()
Explainwhatismeantbymemberwisecopyandwhatproblemsitmightcause
Explainhowcopyconstructorssolvetheproblemofmemberwisecopy
Demonstratewhencopyconstructorsarenecessary
Differentiatebetweenacopyconstructorandaconvertconstructor
Explainwhenclassdestructorsarenecessary
Differentiatebetweenaconvertconstructorandobjectconversionusingtheoverloaded
DefinethefollowingOOPconcept:
composition
DefinethefollowingOOPconcepts:
inheritance,polymorphism
ExplainhowtheconceptofinheritanceisimplementedusingC++
Explainhowinheritanceandcompositionprovidescodereusability
Compareandcontrastcompositionandinheritance
Demonstratehowpolymorphismisimplementedusinginheritancewithvirtualfunctions
Compareandcontrastprivateversuspublicinheritance
Identifytheaccessibilityofdatamembersandmemberfunctionsthatweredeclaredprivate,public,orprotectedtoclassmemberfunctions,toinheritedclassmemberfunctionsandtooutsidememberfunctions
Explaintheadvantageofusingprotecteddatamemberswithinaninheritancehierarchy
Identifytheorderinwhichconstructorsanddestructorsareinvokedwhenderivedclassobjectsareinstantiated
Identifythepitfallsofmultipleinheritanceandhowtheycanbeaddressed
Explainhowinheritancecanbeusedtospecializeorgeneralizeabaseclass
Explainhowinheritancecanbeusedtohidedatamembersand/ormemberfunctionsofabaseclass
Listtheadvantagesanddisadvantagesofdynamicversusstaticbinding
ExplainhowdynamicbindingisimplementedinC++usingvirtualmethods
Explainanddemonstratewhyvirtualdestructorsmightbenecessaryifdynamicmemoryallocationtakesplaceswithinabaseandderivedclass
ListseveralreasonsthatC++allowsustodefinefriendfunctions
Usetheifstreamandofstreamobjectstoaccess,processandstoredataondiskfiles
Identifyfstreamclassmemberfunctionsandhowtheyareused:
open(),is_open(),operator!
(),fail(),eof()
Explainwhyitisimportanttocloseafilewhenitisnotbeingused
Differentiatebetweentextfilesandbinaryfileformats
Differentiatebetweensequentialfileandrandomfileprocessing
Explainwhydelimitersarenecessaryinordertoprocesstextfilesandwhyblankscannotalwaysbeusedasdelimiters
Developcodethatimplementsexceptionhandlingtechniquesusingtry,catchandthrow
Explainwhydesigningaclassthatthrowsexceptionsmaybemorepreferablethandisplayingerrormessagesonthescreen.
Explainhowusingtemplatesallowsustoimplementgenericclassesorgenericfunctions
Explainwhytheimplementationofoperatoroverloadingisintrinsictotheuseofmanytemplates
Givenspecificationsofaclass,writeC++codenecessarytoimplementaclass,includingdefault,copy,andconvertconstructors,destructors,memberfunctions,overloadedoperators,variouslevelsofaccessibility(public,privateandprotected)
DemonstratehowC++implementsinheritancebydefiningbasedandderivedclasses
Givenahierarchyofclasses,identifywhichdatamembersandmemberfunctionsareaccessiblebasedontheaccess-specifierusedwhenthederivedclassisininheritedfromthebaseclass
COURSE/INSTITUTIONALOBJECTIVES
Thiscourseisintendedtofine-tunetheanalyticalandtechnicalskillsstudentsneedtofunctioninourincreasinglytechnologicalsociety.ThiscourseprovidesstudentswithextensiveexperienceindevelopinganddebuggingcomplexC++codetosolvecomplicatedbusinessandmathematicalproblems.Itservestopreparethestudenttopursueacareerinthehighlycompetitivefieldsofcomputerprogrammingand/orsystemsanalysis.
COURSECONTENT
Gaddisbook:
Chapters7,11,12,13,14,15
Deitelbook:
Chapters7,9,10,12,13,14,20,21(Section21.7)
Classes
Compareandcontrastdifferenttypesofconstructors
Explaintheimportanceandsignificanceofusingheaderinitialization
get()andset()methods–whyaretheynecessary?
inlinefunctions–whatadvantagedotheyprovide?
Whatarethelimitations?
Introduceconceptsofdatahidingandencapsulation
Explainhowoverloadedfunctionsareidentifiedwithargumentsignatures
Demonstratehowtoinvokememberfunctionsto"sendmessages"toaninstanceofaclass
Usepointerstoclassobjects
Explainwhentousestaticdatamembersandstaticmemberfunctionsandhowtheydifferfromregulardatamembersandmemberfunctions
Giveexamplesoffunctionsandclassesthatmightbedeclaredfriendsofotherclassesandexplainwhy
DynamicMemoryAllocationandMemoryManagement
Discussmemorymanagementprovidedbycstringfunctions.Whyisthe'\0'soimportant?
Discusshowmemoryismanagedwhenstructsandclassesareused.Howisamemberwisecopyperformed?
Whatisthedifferencebetweenadeepandshallowcopy?
Dynamicmemoryallocation-howandwhyisitused?
Howandwhythecopyconstructorandoverloadedassignmentoperatorareusedforclassesthatperformdynamicmemoryallocation
Explainhowtousethethispointer
OperatorOverloading-ConceptsandImplementation
overloadingthe+,-,++(postfixandprefix)
overloadingrelationaloperators
overloadingstreaminsertionandextractionoperators
overloadingthe[]operator
conceptofoperatorstacking
objectconversionusingconvertconstructorsandoverloadedcastoperator
creatingastringclassthatsupportsoverloadedoperators
Objectcomposition-conceptandimplementation
Demonstratehowobjectcompositionallowsustoreusecode
Demonstratewhytheouterobjectmustprovideadditionalmethodstoallowaccesstotheobjectsthatitcontainssincetheirmethodsandattributesarehiddenfromoutsideview
Showhowauserinterfaceswithjusttheouterclassandhowthatclasspassesalongthemessagestotheobjectsitcontains.
CharacterManipulation
datavalidation
charactercaseconversion
I/Ousingcharacterarraysandthecinobject
libraryfunctionsthatmanipulate"strings"
string/numericconversion
usingtheC++stringclass
Inheritance
Whatisinheritance,when,howandwhyitisused
Whateffectdoesaccessspecificationhave?
public,private,andprotected
Whendoweuseeachtypeofspecification?
constructorsversusdestructorsinaninheritancehierarchy
Functionoverridingversusfunctionoverloading
Whatispolymorphism,whyandhowisitimplementedinaninheritancehierarchy?
Differentiatebetweenearlybindingandlatebinding.Enumerateadvantagesofeach.
Whatisavirtualfunction,howisitimplementedandwhatpurposedoesitserve
Whatisapurelyvirtualfunction
HowisRTTIusedwithpolymorphismtoidentifytypeswithinaninheritancehierarchy
Howisdynamiccastingusedtoconvertobjectswithinaninheritancehierarchy
Whatisanabstractbaseclass,howisitimplementedandwhymightitbeused?
Whatarethedrawbacksofmultipleinheritance,howaretheyhandledincodeandwhyismultipleinheritanceused
SequentialFileProcessing
Whatisafileandhowisitaccessed?
Storingtextdataonafile:
howisdatastoredandretrieved
Howisnumericdatastoredinatextfile
candatawithinatextfilebemodified?
Howisatextfile"modified"ifdatachanges?
Whymustdelimitersbeused?
Isusingablankasadelimiteralwaysagoodchoice?
Whyisexceptionhandlingespeciallyimportantwhenprocessingfiles?
Howdowecheckforandaddressfileerrorconditions?
Whatkindoferrorconditionsshouldweanticipate?
Howcanfilesbeusedbyclassconstructorsanddestructorstoimplementobjectpersistence?
RandomFileAccess
Howdoesbinarydatadifferfromtextdata
usingstructstocreatefixedlengthrecords
Howistextandnumericdatastoreddifferentlyinrandomfilesthaninsequentialtextfiles?
Considerabusinesscasestudythatimplementsabusinessapplicationusingrandomfileprocessing
input/outputofobjects
Exceptionhandling
whatisexceptionhandlingandwhenshoulditbeused
identifyingexceptionconditions
throwingexceptionsinsteadofdisplayinganerrormessage
handlinganexceptionusingthetryandcatchclauses
rethrowinganexception
usingthelibrar