Sie sind auf Seite 1von 8

CarletonUniversity DepartmentofSystemsandComputerEngineering SYSC2006FoundationsofImperativeProgrammingFall2013 CourseOutline

Instructors SectionA:DonBailey,ME4438,bailey@sce.carleton.ca.OfficehoursarepostedoncuLearn. SectionB:Dr.MagedElaasar,ME4230,maged.elaasar@carleton.ca.Officehoursarepostedon cuLearn. UndergraduateCalendarCourseDescription SYSC2006[0.5credit] FoundationsofImperativeProgramming Modularprogrammingwithaprocedurallanguage.Compilationandlinking,libraries.Memory managementandobjectlifetimes:staticallocation,automaticallocationinstackframes,dynamic allocationfromtheheap.Introductiontodatastructures:dynamicarrays,linkedlists.Collections:lists, stacks,queues.Introductiontorecursion. PrecludesadditionalcreditforSYSC1102andSYSC2002. Prerequisite(s):ECOR1606orSYSC1005. Lecturesthreehoursaweek,laboratorytwohoursaweek. CourseAimsandObjectives Aims Aftercompletingthiscourse,studentswillbeabletoimplementsmallscale,modularCprograms. Studentswillbeabletovisualizehowmemoryismanagedbyanexecutingprogram,anddemonstrate thisknowledgepictorially.Studentswillbefamiliarwiththedesignandimplementationofsimple abstractlinearcollectionssuchasthelist(vector),queueandstack.Studentswillbeabletoconstruct simplerecursivefunctions.Studentswillbepreparedtoundertakeacoursethatprovidesathorough introductiontoobjectorientedprogrammingprinciples.Studentswillunderstandtheconceptsthat underliemostimperativeprogramminglanguagesandbepreparedtoapplytheseconceptswhen learningnewlanguages. Objectives Astudentwillbeableto: design,code,testanddebugsmallscaleCprograms(e.g.,upto500linesofcode)thatare partitionedintomultiplemodules traceaprogram'sexecutionanddrawdiagramsthatillustratehowmemoryisallocatedbythe programinotherwords,depictthecontentsoftheprogram'sstaticvariables,itsstackframes (containingfunctionargumentsandlocalvariables),andmemorythathasbeenallocatedfrom theheapandisaccessedthroughpointervariables design,codeandtestfunctionsthatoperateontwofundamentaldatastructures:thedynamic (resizable)arrayandthepointerbasedsinglylinkedlist describe,fromaclientsideperspective,theoperationsprovidedbysomelinearabstract collectionse.g.,list(vector),queue,andstack 1

implementthesecollectionsi.e.,giventhespecificationofacollection'soperationsanda descriptionofitsunderlyingdatastructure,implementthedatastructureandalgorithmsthat providetherequiredoperations specifysimplerecursivealgorithms,convertthesealgorithmsintorecursivefunctions,anddraw stackframediagramstoexplaintheirexecution.

Prerequisite ECOR1606orSYSC1005aretheprerequisitesforSYSC2006.Prerequisitewaiverswillnot normallybegranted.StudentswhohavenotreceivedcreditforECOR1606orSYSC1005must withdrawfromSYSC2006bythelastdateforregistrationinFalltermcoursesotherwise,theywillbe deregisteredbeforetheendofterm.StudentswhoreceivedDEFintheSummer2013offeringof ECOR1606areeligibletoregisterinSYSC2006,providedthattheywritethedeferredexamin September2013.ThesestudentscanremaininSYSC2006iftheDEFischangedtoapassinggrade otherwise,theymustwithdrawfromSYSC2006. StudentsintheB.Sc.HonoursinAppliedPhysicswhohavecompletedCOMP1005willbe consideredtohavesatisfiedtheprerequisiteforSYSC2006. Textbooks EssentialC,NickParlante,2003,StanfordCSEducationLibrary,Document#101(45pages) PointersandMemory,NickParlante,2000,StanfordCSEducationLibrary,Document#102(31 pages) LinkedListBasics,NickParlante,2001,StanfordCSEducationLibrary,Document#103(26pages) LinkedListProblems,NickParlante,2002,StanfordCSEducationLibrary,Document#105(35 pages) FreecopiesofthesedocumentscanbedownloadedfromtheStanfordCSEducationLibrary: http://cslibrary.stanford.edu/ CReferences HowtoThinkLikeaComputerScientistCVersion,AllenDowneyandThomasScheffler, 2012. Thisbookisavailableunderalicensethatallowsreaderstofreelycopyanddistributethetext. APDFcopyofthemostrecentversioncanbedownloadedfromProf.Scheffler's ProgrammiereninCWebpage: prof.beuthhochschule.de/scheffler/lehre/programmiereninc/ Twoversionsareavailable:onewritteninEnglish,theothertranslatedintoGerman.

(Optional)TheCProgrammingLanguage,SecondEdition,BrianW.Kernighanand DennisRitchie,PrenticeHall,1988,ISBN10:0131103628,ISBN13:9780131103627. Oneoftheauthors(Ritchie)wastheoriginaldeveloperofC.Thissecondeditionofthisbook describesthefirststandardversionofC,whichisoftenreferredtoasANSICorC89. Unfortunately,thebookhasnotbeenupdatedtoreflectnewerversionsofthelanguage,suchas C99orC11(themostmoderndialectofC)however,it'sstillwidelyusedandisregardedby manyasbeingtheauthoritativereferenceonC. cuLearn ThiscourseusescuLearn,Carleton'slearningmanagementsystem.ToaccessyourcoursesoncuLearn, gotocarleton.ca/culearn. Forhelpandsupport,gotocarleton.ca/culearnsupport/students.Anyunresolvedquestionscanbe directedtoComputingandCommunicationServices(CCS)byphoneat6135203700orviaemailat ccs_service_desk@carleton.ca. Software PellesC,theCprogrammingenvironmentusedinthiscourse,isfree.Ifyouwanttoinstallthissoftware onyourowncomputer,youcandownloaditfromtheseWebsites: http://www.smorgasbordet.com/pellesc/ http://www.christianheffner.de/ OnlythePellesCSetupprogramneedstobedownloadedandexecuted.Youdon'tneedtodownload theAddInSDKSetupprogram. WeareunabletoprovidesupportforstudentswhoprefertouseMacOSXorLinux.Ifyoudecideto developcodeusingaCenvironmentforoneoftheseoperatingsystems,itisyourresponsibilityto transferyourcodetoaPellesCprojectandverifyitsexecutionbeforeuploadingittocuLearn. Attendance Studentsareexpectedtoattendalllecturesandlabperiods.TheUniversityrequiresstudentstohavea conflictfreetimetable.Formoreinformation,seethecurrentUndergraduateCalendar,Academic RegulationsoftheUniversity,Section1.2,CourseSelectionandRegistrationandSection1.5, Deregistration. Requeststoaccommodateamissedmidtermexam,labperiods,duedates,etc.,becauseofconflicts withjobsorvacationplanswillnotbeconsidered. HealthandSafety EverystudentshouldhaveacopyofourHealthandSafetyManual.APDFcopyofthismanualis availableonline:sce.carleton.ca/courses/healthandsafety.pdf.

EvaluationandGradingScheme Studentswillbeevaluatedprimarilybymeansofamidtermtestandafinalexam.Inaddition,themarks assignedforlabworkandpopquizzeswillcontributetowardsthefinalgrade. Topassthecourse,studentsmustpassthefinalexamination(50%orbetter).Forstudentswhopassthe finalexam,anumericmarkoutof100willbecalculatedbyweightingthecoursecomponentsasfollows: Labwork Popquizzes Midtermtest Finalexam 10% 10% 25% 55%

Thismarkwillbeconvertedtoyourfinallettergrade,usingthetableofpercentageequivalentsshownin Section2.3oftheAcademicRegulationsoftheUniversity. LabPeriods Attendanceatthescheduledlaboratoryperiodsismandatory,andattendancewillbetaken.Duringthe labsyouwillworkonshortprogrammingexercisesthatareintendedtohelpyouunderstandparticular conceptsthathavebeenintroducedinthelectures.Youwillnormallyberequiredtodemonstrateand/or submityourlabworkbytheendofthelabperiod(orotherspecifieddeadline),asindicatedinthat week'slab"handout". Yourworkineachlabperiodwillbegradedsatisfactory,marginal,orunsatisfactory. Satisfactorymeansthatyouwerepresentatthelabandmadereasonableprogresstowards completingthelabexercises.Notethatyoudonothavetofinishalltheexercisestoreceivea satisfactorygrade. Marginalmeansthatyoumadesomeprogresstowardscompletingtheexercises,butyour solutionstowerenotsufficientlycompletetowarrantasatisfactorygrade.Thisgradeindicates thatyoumaybefallingbehind,andshouldtakestepstoremedythissituation. Unsatisfactorymeansthatyouwereabsentfromthelabperiod,oryouattendedbutmadelittle ornoprogresstowardscompletingthelabexercises.Thisindicatesthatyouarelikelyhaving difficultyunderstandingimportantconceptsandshouldseekhelpfromyourinstructorassoonas possible.Youwillalsoreceiveunsatisfactoryifyoudonotdemonstrateorsubmityourwork beforethedeadlineorifitisapparenttotheTAthatyoudidnotdoenoughofthelab workonyourownthatis,youreliedonyourcolleaguestoexplaintheexercisesand providesolutions(approach,algorithmsorcode). Foreachsatisfactoryormarginalgrade,youwillreceive1/1towardsthelabcomponentofthe course.Eachunsatisfactorygradewillreceive0/1. Yourlowesttwolabmarkswillnotbecountedwhencalculatingyourfinalgrade.Thismeansyoucan haveuptotwounsatisfactorylabmarksandstillearnfullmarks(100%)forthelabcomponentofthe course. 4

Ifyouareabsentfromalabperiodforanyreason,youwillreceive0/1forthatlab.Ifyouareunableto attendalabbecauseofillness,youarenotrequiredtoprovideamedicalcertificatetoexplainyour absence.Itisuptoyoutodothemissedlabworkonyourowntimehowever,youcannotsubmityour completedlabworklatetoreceivecreditforthemissedlab.Pleasedonotaskforexemptionsand/or extensionsbecauseofillnessandsoon.Youcanmissuptotwolabperiodsandstillreceivefullcredit forthelabcomponent,butit'suptoyoutouseyour"excusedabsences"wisely.Seriouslongterm illnesswillbedealtwithonanindividualbasisinthesecircumstances,pleasecontactyourinstructorto discussappropriatearrangements. Portionsofthedesignsandcodefromanylabmaybereusedandrefinedinsubsequentlabs,anddoing thelabsisthebestwaytolearnthecoursematerialandpreparefortheexams,sostudentsare encouragednotto"writeoff"anyparticularlabjustbecauseofitsrelativelylowweightintheoverall gradingscheme. StudentscanusetheSystemsandComputerEngineeringundergraduatecomputerlabswheneverthe MackenzieBuilding,MintoCASEandtheCanalBuildingareopen,exceptforthosetimeswhenlabs arereservedforspecificcourses. PopQuizzes Shortpopquizzeswillbeheldduringsomeofthelectures.Theyareintendedtoprovideyouwith additionalfeedbackonyourprogresstowardsmeetingthecourseobjectives. Youwillreceive1/1foreachquizyouattempt,evenifyoursolutionsareentirelywrong.Theonlyway youwillreceive0/1foraquizisifyoudonotattemptit.Inotherwords,themarksyoureceiveforthe quizzesarebasedoneffort,notthecorrectnessofyoursolutions.Assuch,thereisnothingtobegained bycopyingsolutionsfromacolleagueinsteadofattemptingthequestionsonyourown:itmakes absolutelynodifferencetoyourquizscore,andcompletelydefeatsthepurposeofthequizzes. Yourquizmarkwillbecalculatedusingtheformula: 10*numberofquizzesattempted/(numberofquizzesheld*0.8) toamaximumof10marks.Thismeansyoucanmissupto20%ofthequizzesandstillearnfullmarks (100%)forthepopquizcomponentofthecourse. Exams Therewillbeoneclosedbookmidtermtest,whichwillbeheldapproximatelyonehalfoftheway throughtheterm.ThedateoftheexamwillbeannouncedinclassandpostedoncuLearn.Computers willnotbeusedduringthemidtermtest. Studentswhoareunabletowritethetestbecauseofillnessorothercircumstancesbeyondtheircontrol mustprovideincasesofillnessamedicalcertificatedatednolaterthanoneworkingdayafterthetest, orappropriatedocumentsinothercases.Medicaldocumentsmustspecifythedateoftheonsetofthe illness,the(expected)dateofrecovery,andtheextenttowhichthestudentwas/isincapacitatedduring 5

thetimeofthetest.Ifthisinformationisprovidedtotheinstructornolaterthanfiveworkingdaysafter thetest,theweightofthefinalexamwillbeincreasedtocoverthemissedtestotherwise,themarkfor themissedtestwillbe0. Requestsforaccommodationbecauseofpoorperformanceonthemidtermtestwillnotbeconsidered. Therewillbenomakeuptest.So,ifyouareillonthedayofthemidtermtest,don'twritethetestand laterclaimthatyourperformancewasimpairedbecauseyouwereunwell.Youarebetterofftomissthe testandrequestthattheweightofyourfinalexambeincreased,byfollowingtheprocedureoutlined earlier. AclosedbookfinalexamwillbeheldduringtheUniversity'sDecemberexaminationperiod.The AcademicRegulationsoftheUniversitypermitinstructorstospecifyrequirementsthatmustbe satisfiedforstudentstobeeligibletowritethefinalexaminationor,wherecircumstanceswarrant,the deferredfinalexamination. Allstudentsareeligibletowritethefinalexamination,regardlessofthemarkstheyreceived duringtheterm. Studentswhomissthefinalexam,butearnedatleast60%inthelabcomponentandwrotethe midtermtest(orprovidedacceptabledocumentationtoexplaintheirabsencefromthetest)will receivethegradeABS.Thesestudentswillbedeemedtohaveperformedsatisfactorilyduring thetermwhentheirapplicationsforadeferralofthefinalexaminationareconsidered.Formore information,seethecurrentUndergraduateCalendar,AcademicRegulationsoftheUniversity, Section2.2,TheCourseOutlineSection2.3,StandinginCourses/GradingSystemand Section2.5,DeferredFinalExaminations. StudentswhomissthefinalexambuthavenotsatisfiedtheconditionsforreceivingABS,aslisted above,willreceivethegradeFND.Thesestudentsareineligibletowritethedeferredfinalexam.

Computerswillnotbeusedduringthefinalexam. Thefinalexaminationisforevaluationpurposesonlyandwillnotbereturnedtostudents.Youwillbe abletomakearrangementswithyourinstructortoseeyourmarkedfinalexaminationafterthefinal gradeshavebeenmadeavailable.Yourexamwillnotberemarkedduringthismeetingandsolutionsto theexamquestionswillnotbeprovided. AppealofGrade Theprocessesfordealingwithquestionsorconcernsregardinggradesassignedduringthetermand finalgradesisdescribedintheAcademicRegulationsoftheUniversity,Section2.7,Informal AppealofGradeandSection2.8,FormalAppealofGrade. EarlyFeedback SeeSection2.2.1oftheAcademicRegulationsoftheUniversity. Theweeklylabexerciseswillnormallybegradedduringthelabperiod.Outsideofthescheduledlabs, youcanobtainfeedbackduringofficehoursorbymakinganappointmenttoseeyourinstructor.

Themidtermtestwillbemarkedandreturnedpriortothe40'thteachingdayoftheterm. AcademicAccommodations Youmayneedspecialarrangementstomeetyouracademicobligationsduringtheterm.Torequest academicaccommodation,theprocessesareasfollows: Pregnancy Emailmewithanyrequestsforacademicaccommodationduringthefirsttwoweeksofclass,orassoon aspossibleaftertheneedforaccommodationisknowntoexist.Formoredetails,visittheEquity Serviceswebsite:http://www2.carleton.ca/equity ReligiousObligations Emailmewithanyrequestsforacademicaccommodationduringthefirsttwoweeksofclass,orassoon aspossibleaftertheneedforaccommodationisknowntoexist,butinnocaselaterthanthesecondlast weekofclasses.Formoredetails,visittheEquityServiceswebsite:http://www2.carleton.ca/equity AcademicAccommodationsforStudentswithDisabilities ThePaulMentonCentreforStudentswithDisabilities(PMC)providesservicestostudentswith LearningDisabilities(LD),psychiatric/mentalhealthdisabilities,AttentionDeficitHyperactivityDisorder (ADHD),AutismSpectrumDisorders(ASD),chronicmedicalconditions,andimpairmentsinmobility, hearing,andvision.Ifyouhaveadisabilityrequiringacademicaccommodationsinthiscourse,please contactPMCat6135206608orpmc@carleton.caforaformalevaluation.Ifyouarealready registeredwiththePMC,contactyourPMCcoordinatortosendmeyourLetterofAccommodationat thebeginningoftheterm,andnolaterthantwoweeksbeforethefirstinclassscheduledtestorexam requiringaccommodation.AfterrequestingaccommodationfromPMC,meetwithmetoensure accommodationarrangementsaremade.PleaseconsultthePMCwebsiteforthedeadlinetorequest accommodationsfortheformallyscheduledexam: http://www1.carleton.ca/pmc/students/datesanddeadlines/ YoucanvisittheEquityServiceswebsitetoviewthepoliciesandtoobtainmoredetailedinformation onacademicaccommodation:http://www2.carleton.ca/equity accommodationarrangementsaremade.PleaseconsultthePMCwebsiteforthedeadlinetorequest accommodationsfortheformallyscheduledfinalexam. Formoreinformation,refertotheStudentssectionofthePaulMentonCentreWebsite: http://www1.carleton.ca/pmc/students

Topics MostofthecodeexampleswillbewritteninC,butforcomparisonpurposes,PythonorJavaexamples mayalsobepresented.Cwillbetheonlyprogramminglanguagethatwillbeusedinthelabwork,the midtermtestandthefinalexam.. Fundamentalelementsofimperativeprogramminglanguages:types,variables,expressions, controlflow:conditionalstatements,iteration(loops),functions(subroutines/procedures). Introductionto/reviewofCasanimperativeprogramminglanguage: types,variables,expressions,i f ,w h i l e ,f o r andd o w h i l e statements,function definitionsvs.functiondeclarations. Functioncallsandthecallstack.Visualizingprogramstatebydrawingactivationrecords(stack frames)depictingparametersandlocalvariables. Structuringdata:arraysandcharacterstrings.ArraysandcharacterstringsinC. Motivationformodularprogramming.Modules:interfacevs.implementation. BriefoverviewofthestandardClibrary. ModulesinC:header(.h )andimplementation(.c )files.TheCpreprocessor.Compilingand linkingCprogramscomprisedofseveralmodules.BriefoverviewofthestandardClibrary. Pointers.Depictingpointersindrawingsofactivationrecords. Cpointers.The& and* operators.Passingpointerstolocalvariablesasfunctionarguments.C arraysandpointers.Drawingactivationrecordstoexplainhowpointerstoarraysarepassedas functionarguments. Structuringdata:structures. Cs t r u c t s.Structuresvs.pointerstostructuresasfunctionarguments.The > operator. Introductiontodynamicallyallocatedmemoryandtheheap. HeapmanagementinC:m a l l o c andf r e e .Dynamicallyallocateds t r u c t s.Drawing memorydiagramstoexplainhowparametersandlocalvariablesinactivationrecordspointto memoryblocksallocatedontheheap.Memoryleaks. Dynamicallyallocatedarrays,dynamicarrays. Casestudy:Cimplementationofalistcollectionusingadynamicarray. Structuringdata:linkedlists. Fundamentaloperationsonsinglylinkedlists.ImplementationinC,usings t r u c t sand pointers. Casestudy:stackandqueuecollectionsimplementedinCusingasinglylinkedlist. TheCpreprocessorandmacros. Introductiontorecursion. Lastedited:September4,2013.

Das könnte Ihnen auch gefallen