专业英语听力材料.docx
《专业英语听力材料.docx》由会员分享,可在线阅读,更多相关《专业英语听力材料.docx(44页珍藏版)》请在冰豆网上搜索。
专业英语听力材料
Lecture2前17分钟
Lecture2后17分钟
Lecture3前18分钟
Lecture3后17分钟
Lecture4前18分钟
Lecture4后18分钟
Lecture5前17分钟
Lecture5后15分钟
Lecture6前19分钟
Lecture6后15分钟
Lecture7
Lecture8前15分钟
Lecture8第15—30分钟
Lecture8第30—48分钟
Lecture8第48—完
Lecture2前17分钟回首页
Thisiscomputerprogramming1fromtheUniversityofWashington.Welcomeback!
Todayinlecture2,we’llbegoingrightintothetechnicalcontentofthiscourseaswetalkaboutproblems,algorithmsandprograms.Asyoumaybeaware,programmingacomputerinvolvesagreatamountofdetail.We’llhaveplentyoftimelaterinthiscoursetogettoomanyofthosedetails.Butprogrammingalsoinvolveshigherlevelconceptsinproblemsolvingskills.I’dliketofocusonthattoday,lateronwe’llseedetailswhichwillhelpuscarryoutthesehigherlevelproblemsolvingstrategies.Sowe’lltalktodayaboutwhatproblemsmightbesolvedbycomputers,whatalgorithmsareandwhatprogramsare.We’llaboutageneralapproachtosolvingproblemswithcomputersanddiscusshowaresolutionscanbeturnedintocodethataCPUcanactuallyexecute,we’llfocustodayontheselargeideas.Tostartwith,computerprogrammingisprimarilyamatterofusingacomputertosolveaproblemthatmightbeonedefinitionofprogramming,problemsolvingthroughcomputers.Nownotallproblemsthatwerefertobythatnameineverydayusemightbeamenabletosolutionbycomputer.Problemoftrafficjamsduringrushhourforexample,probablycan’tbesolvedbywritingacprogram,andthesamegoesforproblemslikeworldpeaceorworldhunger.Heartofthisartprogrammingisbeabletorecognizewhichproblemsaresuitableforsolutions.Ingeneral,aproblemthatacomputercansolvehastobeoneforwhichyouasaprogrammercancomeupwithanalgorithm.Analgorithmisasequenceofprecisestepswhichwillleadthesolutionoftheproblem.Ifyoucan’tcomeupwiththealgorithmorsequenceofsteps,thenyoucan’tuseacomputertosolvetheproblem.Thesestepshavetobequitpreciseandtheyhavetobemechanicalinthesensethattheywillbecarriedoutbyamachine,thecomputeroncetheprogrammingisdone,ratherthanbyhumanbeing.Notionofthealgorithmisafundamentaloneanditperhapsquitedistinguishescomputersciencefromotherfieldsofscienceandengineering.Certainlyalgorithmsareusedinmanyotherfields,butnoworryexceptioncomputerscienceisthealgorithmitselfofnotion,naturenaturalcharacteristicskeepabilitiesofalgorithmsofcentralareaofstudy.Ifyoucancomeupwithanalgorithm,thenthenextstepisturnthatalgorithmintoacomputerprogram,alotofthiscoursewillbeaboutthatprocesstakingthealgorithmandturnitintoaprogramthatcanbeexecuted.Nowweexpressthesealgorithmsusingwhatwecallaprogramminglanguage,thisisaspecialnotationthatwewillbeabletotranslateintoaformthattheCPUitselfwillbeabletoexecute.OurcoursefocusesontheClanguage,therearemanyotherprogramminglanguagesthatyoumightheardseveralofthem,C++,Java,bothofwhicharequitcloselyrelatedtoCandderive(起源)tranit,othersFORTRAN,Basicyoumayhaveexperiencewith.Let’scompareprogrammingtoanotherkindofalgorithm-makeactivitythatwe’refamiliarwithfromeverydaylife,namelycooking.Solet’stakeatypicalproblem,youarehungry,youneedtoeatsomething,Fudgebrowniesoundsreallygood.Sohereistheproblem:
youwanttomakesomeFudgebrownie.OK,thatcoursebounds(跳跃)tothestatementoftheproblem,thegoal:
makeFudgebrownie,what’sthealgorithm?
Well,incookingwecallthatarecipe,arecipeissomethinglikeopentwobagsofchocolatechipsputtheminthebowl,addtwotablespoonsofflour,stir(搅拌)themtogetherandbakethemintheovenfor3hours,orwhateverthealgorithmis,youmayknowmoreaboutcookingthanIdo.OK,that’sthealgorithmknown,thestepbysteprecipethattellswhatthingstodoinwhatorder.Nowisthatquitlikeaprogram?
Well,notquit,whenwewriteaprogram,wewillbegiven(?
?
?
?
?
)ittoaparticularcomputertoexecuteandwehavetowriteitinalanguageandnotationsthatthecomputerunderstands.Justlikearecipehastobewritteninalanguagethatthe(shouldbean‘a’here)cookunderstands.OK,soImayknowthesestepstogothroughanyingredientsbutI’vegottosaythatinEnglish,inRussian(orlan口误)orinwhateverthelanguagethecookis,you‘vegottousetherightterminology,therightoperationsanddoeverythinginexactlytherightorderbutnotendupwithFudgebrownie.OK,andIstillbehungryandIwanttosolvemyproblem.
Hereisitsprocedurethatmanypeoplefindusefulasageneralstrategyforsolvingproblemswithacomputer.Thefirststepmaybeobviousbutit’sforstating,it’stospecifywhattheproblemis.Now,althoughit’sobvious,it’softenhardtodo.Problemthatyouaregiventosolvebyclient,customer,ateacheraresometimesvague(含糊不清的)andmaytakeconsiderable(这里应该是个类似“额外的”意思的词)amountofthenextstepofprocess,analysis.Studyingtheproblem,understandwhatitreallymeans,whatreallysort,learningmoreaboutit,asmuchasyoucanfindoutaboutit,eventuallyfromthatstudy,youhopeyoucandesignanalgorithmstepbystepprocedurefordesigningtheproblem(此句有误,后面是补充。
),designingthesolutiontotheproblems.Onceyou’vegotthealgorithmfirmlyinmind,youcanthenimplementthealgorithm,thismeanswritingaprogram.Nowit’sreallyonlyatthisstateyouneedknowledgeoftheprogramminglanguage.Soyoucandotheproblemtransactions,theanalysis,thedesignwithoutknowingwhetheryouweregoingtouseCorJava(?
?
?
?
?
)orFORTRAN,andthenattheimplantationstagebegintranslatingthatanalysisandalgorithmintotheprogramminglanguageyourcomputerwilluse.Areyoudoneyet?
Well,itwouldbeniceifthatwasthelaststep,butit’sveryeasytomakemistakessomewhereinthisprocesssotheprogramthatyouwritehastobetested,verifiedandindoingsoyoumayfindoutitdoesn’tworkexactlyasyouplannedto.Whereisthemistake?
Wellitmightbeintheprogrammingbutyoumayfindoutitwassomeoversetdesignormaybeyouhavetogobackevenafurtherlevel,maybetheanalysiswaswrongortheproblemwasstatedwrongoryoumisunderstoodwhatthepersonwhogivesyoutheproblemwanted.Allofthesethingswillrequirereanalysis,redesigningandfixingtheproblemorhopefullyfixingtheproblemandprogramandtryagain.Itwillkeepprocessinvolvingallofthesesteps.Let’stakeasimpleproblemandapplythisproceduretoit.OK,hereisaproblem:
isagivennumberevenorodd?
Soundssimple?
Yes,itissimple.Whyisitsuchasimpleproblem?
Youmayseenotrealisticallysimpletospendtimeoninacourse.Butactually,it’snotsofarremovefromreallifeproblemsyoumightwanttosolveyouhaveapayrollsystemandyouprintcheckseveryotherweekyouhavetodeterminewhetherthisisapayrollweekornot.Whatabouttheproblemsdeterminingwhetherayearisaleapyear?
Thatisasimilarflavortoit.Beyondthat,inacourselikethis,wasslidetheyareusedtopresentinformation.Itisdifficulttocompletelysolveandpresentcomplicatedproblems.Asoneofthereasonsbytheway,thatwerecommendyoulookintothetextbookforthiscourseoranothertextbookoranotherbookonthissubjectsothatyoucanseelarger,morerealisticandmoreinterestingexamples.Butfornow,thisexamplewillserveuswellandallowsustogothroughallofthestepsrecommendedforproblemsolvingandwhenwe’redonewe’llcomeupwithacompletesolutiontotheproblemincludingcode.SowhatwouldIsaythefirststepwas?
StatetheproblemuponIhavedonethatalready.AndsoIcangoontotheanalysis,andhere,youmaystartthinkingabout,uh,what’sreallymeant?
Whatnumbersareallowed?
IsanegativenumberwhatIneedtogetananswerfor?
Whataboutafractionalnumberlike10.3.Thatevenmakesensetoaskquestionforevenoroddyouhavetoaskyourselfthisquestionoryouperhapsasktheclientorteacherwhogiveyoutheproblem.Whereisthisnumbercomefrom?
Isthisnumberthatfixesforever?
Youhavetothinkaboutthatbeforeyoucanwriteanalgorithmfortheprogram.Thenthereisamorebasicquestionaboutwhatevenoroddmean.Withyourmathematicconcepts,en,mostpeoplerememberthisfromtheirschoolmathematicsbutifyouarenotsurethiswouldbeatimetogobackandlookupandremember,remindyourselfwhatthoseconceptsare.Ihavehadevencollegelevelstudentswith12yearsmathematicsbehindthemnotbesurewhetherzeroisanevenoroddnumber.Sothispossiblehasdoubtinyourmindaboutthesethingsandtheanalysisfaceiswhatitmakessensetofigureoutwhatitreallymeant.Finally,programsaysdeterminingtheanswerbuthowdoyoureportthatanswer.Youwantthecomputertolightupabillboard(广告信息)orspeakaword.Howwastheanswertobereported?
Youhavetosightonthattoo.Thisanalysismightleadyoutorestatetheprobleminmoreprecisetermssolet’strytodothatnow.LetmerestatetheproblemI’mreallygoingtosolveasthis:
giveanintegernumber.OK,sonowI’vepaidonthekindofnumberit’sgonnabe,it’sgonnabeaninteger,anumberwithoutdecimalpoints(小数点).Typedinfromthekeyboardsoit’snotbuiltin,itisn’tsentfromasatellite,okorsomeotherobscuremethodasitgonnabetypedin,ifitisaneven,write“even”onthescreensonowwe’llspecifyhowtheansweristobereported.Andifit’soddwe’aregonnawrite“odd”onthescreensonowwehavemuchmoreprecisedefinitionofwhattheproblemisgoingtobeandwecanproceedtothinkaboutanalgorithm.Sohereistheone,le