资源描述:
《第二章 编写简单Python程序(Chapter02_Writing Simple Programs)ppt课件.ppt》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、PythonProgramming,3/e1PythonProgramming:AnIntroductiontoComputerScienceChapter2WritingSimpleProgramsObjectivesToknowthestepsinanorderlysoftwaredevelopmentprocess.Tounderstandprogramsfollowingtheinput,process,output(IPO)patternandbeabletomodifytheminsimpleways.Tounderstan
2、dtherulesforformingvalidPythonidentifiersandexpressions.PythonProgramming,3/e2PythonProgramming,3/e3ObjectivesTobeabletounderstandandwritePythonstatementstooutputinformationtothescreen,assignvaluestovariables,getnumericinformationenteredfromthekeyboard,andperformacounted
3、loopPythonProgramming,3/e4TheSoftwareDevelopmentProcessTheprocessofcreatingaprogramisoftenbrokendownintostagesaccordingtotheinformationthatisproducedineachphase.PythonProgramming,3/e5TheSoftwareDevelopmentProcessAnalyzetheProblemFigureoutexactlytheproblemtobesolved.Tryto
4、understanditasmuchaspossible.PythonProgramming,3/e6TheSoftwareDevelopmentProcessDetermineSpecificationsDescribeexactlywhatyourprogramwilldo.Don’tworryabouthowtheprogramwillwork,butwhatitwilldo.Includesdescribingtheinputs,outputs,andhowtheyrelatetooneanother.PythonProgram
5、ming,3/e7TheSoftwareDevelopmentProcessCreateaDesignFormulatetheoverallstructureoftheprogram.Thisiswherethehowoftheprogramgetsworkedout.Developyourownalgorithmthatmeetsthespecifications.PythonProgramming,3/e8TheSoftwareDevelopmentProcessImplementtheDesignTranslatethedesig
6、nintoacomputerlanguage.InthiscoursewewillusePython.PythonProgramming,3/e9TheSoftwareDevelopmentProcessTest/DebugtheProgramTryoutyourprogramtoseeifitworked.Ifthereareanyerrors(bugs),theyneedtobelocatedandfixed.Thisprocessiscalleddebugging.Yourgoalistofinderrors,sotryevery
7、thingthatmight“break”yourprogram!PythonProgramming,3/e10TheSoftwareDevelopmentProcessMaintaintheProgramContinuedevelopingtheprograminresponsetotheneedsofyourusers.Intherealworld,mostprogramsarenevercompletelyfinished–theyevolveovertime.PythonProgramming,3/e11ExampleProgr
8、am:TemperatureConverterAnalysis–thetemperatureisgiveninCelsius,userwantsitexpressedindegreesFahrenheit.