CHowtoProgramdoc.docx
《CHowtoProgramdoc.docx》由会员分享,可在线阅读,更多相关《CHowtoProgramdoc.docx(16页珍藏版)》请在冰豆网上搜索。
CHowtoProgramdoc
TOUROCOLLEGECOURSESYLLABUS
LANDERCOLLEGE
DEPARTMENT:
COURSETITLE:
COURSENUMBER:
PREREQUISITES:
CREDITHOURS:
DEVELOPER:
LASTUPDATE:
ComputerScienceDataStructuresMCO242
MCO232
3
MiriamPionczak
July2003
COURSEDESCRIPTION
ThiscourseexploresthemoreadvaneedconceptsoftheObjectOrientedDesignandProgrammingparadigmincludingoperatoroverloading,inheritaneeversuscomposition,polymorphism,run-timeversuscompiletimebinding,multipleinheritanee,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:
inheritanee,polymorphism
ExplainhowtheconceptofinheritaneeisimplementedusingC++
Explainhowinheritaneeandcompositionprovidescodereusability
Compareandcontrastcompositionandinheritanee
DemonstratehowpolymorphismisimplementedusinginheritaneewithvirtualfunctionsCompareandeontrastprivateversuspublicinheritanee
Identifytheaccessibilityofdatamembersandmemberfunctionsthatweredeclaredprivate,public,orprotectedtoclassmemberfunctions,toinheritedclassmemberfunctionsandtooutsidememberfunctions
Explaintheadvantageofusingprotecteddatamemberswithinaninheritaneehierarchy
Identifytheorderinwhicheonstructorsanddestructorsareinvokedwhenderivedclassobjectsareinstantiated
Identifythepitfallsofmultipleinheritaneeandhowtheycanbeaddressed
Explainhowinheritaneecanbeusedtospecializeorgeneralizeabaseclass
Explainhowinheritaneecanbeusedtohidedatamembersand/ormemberfunctionsofabaseclass
Listtheadvantagesanddisadvantagesofdynamicversusstaticbinding
ExplainhowdynamicbindingisimplementedinC++usingvirtualmethods
Explainanddemonstratewhyvirtualdestructorsmightbenecessaryifdynamicmemoryallocationtakesplaceswithinabaseandderivedclass
ListseveralreasonsthatC++allowsustodefinefriendfunctions
Usetheifstreamandofstreamobjectstoaccess,processandstoredataondiskfiles
Identifyfstreamclassmemberfunctionsandhowtheyareused:
open(),is_open(),operator!
。
fail(),eof()
Explainwhyitisimportanttocloseafilewhenitisnotbeingused
Differentiatebetweentextfilesandbinaryfileformats
Differentiatebetweensequentialfileandrandomfileprocessing
Explainwhydelimitersarenecessaryinordertoprocesstextfilesandwhyblankscannotalwaysbeusedasdelimiters
Developcodethatimplementsexceptionhandlingtechniquesusingtry,catchandthrow
Explainwhydesigningaclassthatthrowsexceptionsmaybemorepreferablethandisplayingerrormessagesonthescreen.
ExplainhowusingtemplatesallowsustoimplementgenericclassesorgenericfunctionsExplainwhytheimplementationofoperatoroverloadingisintrinsictotheuseofmanytemplatesGivenspecificationsofaclass,writeC++codenecessarytoimplementaclass,includingdefault,copy,andconverteonstructors,destructors,memberfunctions,overloadedoperators,variouslevelsofaccessibility(public,privateandprotected)
DemonstratehowC++implementsinheritaneebydefiningbasedandderivedclasses
Givenahierarchyofclasses,identifywhichda