(二〇一四年六月本科毕业设计外文文献翻译题目:Object-OrientationandC++学生姓名:xxx学院:信息工程学院系别:软件系专业:软件工程班级:软件10-2班指导教师:xxx讲师学校代码:10128学号:xxxxxxxxxxxx内蒙古工业大学本科毕业设计外文文献2Object-OrientationandC++C++isjustoneofmanyprogramminglanguagesinusetoday.Whyaretheresomanylanguages?Whydonewonesappeareveryfewyears?Programminglanguageshaveevolvedtohelpprogrammerseasethetransitionfromdesigntoimplementation.Thefirstprogramminglanguageswereverydependentontheunderlyingmachinearchitecture.Writingprogramsatthislevelofdetailisverycumbersome.Justashardwareengineerslearnedhowtobuildcomputersystemsoutofothercomponents,languagedesignersalsorealizedthatprogramscouldbewrittenatamuchhigherlevel,therebyshieldingtheprogrammerfromthedetailsoftheunderlyingmachine.Whyaretheresuchalargenumberofhigh-levelprogramminglanguages?Therearelanguagesforaccessinglargeinventorydatabases,formattingfinancialreports,controllingrobotsonthefactoryfloor,processinglists,controllingsatellitesinrealtime,simulatinganuclearreactor,predictingchangingatmosphericconditions,playingchess,anddrawingcircuitboards.Eachoftheseproblemsrequiresdifferentsetsofdatastructuresandalgorithms.Programminglanguagesaretoolstohelpussolveproblems.However,thereisnotoneprogramminglanguagethatisbestforeverytypeofproblem.Newprogramminglanguagesareoftendevelopedtoprovidebettertoolsforsolvingaparticularclassofproblems.Otherlanguagesareintendedtobeusefulforavarietyofproblemdomainsandaremoregeneralpurpose.Eachprogramminglanguageimpartsaparticularprogrammingstyleordesignphilosophyonitsprogrammers.Withthemultitudeofprogramminglanguagesavailabletoday,anumberofsuchdesignphilosophieshaveemerged.Thesedesignphilosophies,calledprogrammingparadigms,helpustothinkaboutproblemsandformulatesolutions.1.SoftwareDesignthroughParadigmsWhendesigningsmallcomputerprogramsorlargesoftwaresystems,weoftenhaveamentalmodeloftheproblemwearetryingtosolve.Howdowedeviseamentalmodelofasoftwaresystem?Programmingparadigmsoffermanydifferentwaysofdesigningandthinkingaboutsoftwaresystems.Aparadigmcanbethoughtof内蒙古工业大学本科毕业设计外文文献3asamentalmodelorasaframeworkfordesigninganddescribingasoftwaresystem'sstructure.Themodelhelpsusthinkaboutandformulatesolutions.Wecanusethementalmodelofaparadigmindependentlyfromtheprogramminglanguagechosenforimplementation.However,whenthechosenlanguageprovidesconstructsandmechanismsthataresimilartothosethatarefoundintheparadigm,theimplementationwillbemorestraightforward.Usually,thereareseverallanguagesthatbelongtoaparadigm.Forthisreason,aprogrammingparadigmisalsoconsideredaclassoflanguages.Alanguagedoesnothavetofitintojustoneparadigm.Moreoften,languagesprovidefeaturesorcharacteristicsfromseveralparadigms.Hybridlanguages,suchasC++,combinecharacteristicsfromtwoormoreparadigms.C++includescharacteristicsfromtheimperativeandproceduralparadigms--justlikeitspredecessorlanguage,C--andtheobject-orientedparadigm.THEIMPERATIVEPARADIGM.Theimperativeparadigmischaracterizedbyanabstractmodelofacomputerwithalargememorystore.ThisistheclassicvonNeumannmodelofcomputerarchitecture.Computations,whichconsistofasequenceofcommands,arestoredasencodingwithinthestore.Commandsenablethemachinetofindsolutionsusingassignmenttomodifythestore,variablestoreadthestore,arithmeticandlogictoevaluateexpressions,andconditionalbranchingtocontroltheflowofexecution.THEPROCEDURALPARADIGM.Theproceduralparadigmincludestheimperativeparadigm,butextendsitwithanabstractionmechanismforgeneralizingcommandsandexpressionsintoprocedures.Parameters,whichareessentiallyaliasesforaportionofthestore,werealsointroducedbythisparadigm.Otherfeaturesincludeiteration,recursion,andselection.Mostmainstreamsprogrammingtodayisdoneinaprocedurallanguage.Theproceduralparadigmwasthefirstparadigmtointroducethenotionofabstractionintoprogramdesign.Thepurposeofabstractioninprogrammingistoseparatebehaviorfromimplementation.Proceduresareaformofabstraction.Theprocedureperformssometaskorfunction.Otherpartsoftheprogramcalltheprocedure,knowingthatitwillperformthetaskcorrectlyandefficiently,butwithout内蒙古工业大学本科毕业设计外文文献4knowingexactlyhowtheprocedureisimplemented.THEPROCEDURALPARADIGMWITHADTs.DATAABSTRACTIONisconcernedwithseparatingthebehaviorofadataobjectfromitsrepresentationorimplementation.Forexample,astackcontainstheoperationsPush,Pop,andIsEmpty.Astackobjectprovidesuserswiththeseoperations,butdoesnotrevealhowthestackisactuallyimplemented.Thestackcouldbeimplementedusinganarrayoralist.Usersofthestackobjectdonotcarehowthestackisimplemented,onlythatitperformstheaboveoperationscorrectlyandefficiently.Becausetheunderlyingimplementationofthedataobjectishiddenfromitsusers,theimplementationcaneasilybechangedwithoutaffectingtheprogramsthatuseit.Whenwedesignalgorithms,weoftenneedaparticulardatatypetouseinordertocarryoutthealgorithm'soperations.Thedesignofanalgorithmiseasierifwesimplyspecifythedatatypesofthevariables,withoutworryingabouthowtheactualdatatypeisimplemented.Wedescribethedatatypebyitspropertiesandoperationsandassumethatwhateverimplementationischosen,theoperationswillworkcorrectlyandefficiently.Typesdefinedinthiswayar