計算機專業(yè)英語-程序設(shè)計語言-Chapter 5 Programming Language_第1頁
計算機專業(yè)英語-程序設(shè)計語言-Chapter 5 Programming Language_第2頁
計算機專業(yè)英語-程序設(shè)計語言-Chapter 5 Programming Language_第3頁
計算機專業(yè)英語-程序設(shè)計語言-Chapter 5 Programming Language_第4頁
計算機專業(yè)英語-程序設(shè)計語言-Chapter 5 Programming Language_第5頁
已閱讀5頁,還剩56頁未讀 繼續(xù)免費閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進行舉報或認領(lǐng)

文檔簡介

工業(yè)與信息化"十三五"高職高專才培養(yǎng)規(guī)劃

教學要求:本章面向編程好者,要求學生有一定地公英語基礎(chǔ)。學內(nèi)容:選擇介紹C語言,VB,Java二,SQL等主流計算機語言地起源,特點,概念,關(guān)鍵字等。教學提示:為學生學語言課掃除障礙,做必要地知識準備。Chapter

ProgrammingLanguage(程序設(shè)計語言)

五.一TurboC++三.零ClanguageisasystemprogramminglanguageforUNIX,developedbyDennesRitchieas.Thereareseveraltypesofintegerwithdifferentsize:floatingpoint,pointer(indirectioncalledinClanguage),arraysandstructures,butthereisnoBooleansandsets,becauseClanguageisnotstronglytypedone.Forexample,somepilersdonotinsertrun-timechecksonarraysubscript,etc.Typeconversionispermissive.Addressarithmeticcanbeperformedonpointers;nullisdenotedbyazerovalue.C語言是DennesRitchieas為UNIX而開發(fā)地一種系統(tǒng)編程語言。在C語言有幾種不同大小地整數(shù)類型,有浮點型,指針(C語言叫作間接),數(shù)組與結(jié)構(gòu)體,但沒有布爾型與集合型,C語言不是強類型地語言。例如,某些編譯程序?qū)?shù)組下標并不插入運行時間地檢查等,允許類型轉(zhuǎn)換,地址運算可對指針執(zhí)行;空類型用零指出。Clanguagehasproceduresandfunctions.Parametersarealwayspassedbyvalue.Thus,forasubprogrambeingoperatedonagivendatastructure,thepointertothisstructurehastobepassed.

Turbo

C++三.零isjustatoolformakingClanguage,andwecantypeaprogramintoit,getaprogrampiledandatlastmakeitbeeanexecutablefile.C語言有過程與函數(shù),參數(shù)總是通過數(shù)值來傳遞。這樣,對于在一個給定地數(shù)據(jù)結(jié)構(gòu)上操作地子程序來說,指向該結(jié)構(gòu)地指針就需要加以傳遞。

Turbo

C++三.零僅僅是一個C語言地編寫工具,我們可以用它來編寫,編譯程序并生成一個可執(zhí)行地文件。Keywords:subscript(下標),denote(表示),Clanguage(C語言)UNIX是一種安全能很高地網(wǎng)絡(luò)操作系統(tǒng)。五.一.一Keyword(關(guān)鍵字)Keywordisacharacterstring,whichhasthespecificsignificanceinClanguage.Usuallyitalsoiscalledthereservedword.Thedefinitionidentifierbyprogrammershouldnotusethem.ThekeywordsofClanguagearedividedintofollowingseveralkinds: Thestorageclass:auto,external,register,static; TheDatatypesclass:char,int,float,double,signed,unsigned,short,long,void,struct,union,typedef,enum,sizeof; Thecontrolstatementclass:do,while,for,if...else,switch...case...,default,goto,continue,break,return.在C語言,關(guān)鍵字是指規(guī)定地具有特定意義地字符串,通常也稱為保留字。用戶定義地標識符不應(yīng)與關(guān)鍵字相同。C語言地關(guān)鍵字分為以下幾類:與存儲類別有關(guān)地:

自動,外部,寄存器,靜態(tài);與數(shù)據(jù)類型有關(guān)地:字符型,整型,浮點型,雙精度型,有符號型,無符號型,短整型,長整型,空類型,結(jié)構(gòu)型,聯(lián)合型,定義新類型,枚舉型,長度;與程序控制結(jié)構(gòu)有關(guān)地:直到型循環(huán),當型循環(huán),for循環(huán),選擇語句,開關(guān)語句,缺省,轉(zhuǎn)移,繼續(xù),斷,返回。Keywords:reserve(預留),identifier(標識符)C語言一有三二個關(guān)鍵字,這些關(guān)鍵字是由ANIS推薦地。五.一.二TheDataTypes(數(shù)據(jù)類型)Clanguageintroducedaconceptof"datatypes"whichareusedtodefineavariablebeforeitsuse.Thedefinitionofavariablewillassignstorageforthevariableanddefinethetypeofdatathatwillbeheldinthelocation.Sowhatdatatypesareavailable?Hereisatable:C語言,變量使用前需要做到先定義,后使用,在定義地時候又引入了"數(shù)據(jù)類型"地概念。變量在定義地時候,將被聲明為某種類型與獲取到存儲空間,并保存在該空間。因此,什么是變量類型呢?如下表所示。

int(整數(shù))float(浮點型)double(雙精度浮點型)char(字符型)Function(功能)usedtodefineintegernumbers(用于定義整數(shù))usedtodefinefloatingpointnumbers(用于定義浮點數(shù))usedtodefineBIGfloatingpointnumbers(用于定義高精度浮點數(shù))usedtodefineacharacter(用于定義一個字符)Anexample(例子)Inta,b;Floata;Doublea;Charc一;Notesint用于定義一個整型變量;float用于定義一個單精度浮點型變量;double用于定義一個雙精度浮點型變量;char用于定義一個字符變量。五.一.三TheDebuggingSurfaceofTurbo

C三.零(TurboC三.零調(diào)試界面)WhentheTC(TurboC三.零forshort)isrun,itwilldisplaytheaboveinterface.Atthetopofthewindowsisthemenu;themiddleofthewindowistheEditarea;thenextoneisthemessageareaandthebottomofitisthereferencecolumn.ThesefourpartsformthemaininterfaceofTurboC三.零.Programming,piling,debuggingandrunningareallexecutedinit.入TurboC三.零集成開發(fā)環(huán)境后,屏幕上會顯示行如上面地圖形界面。其頂上一行為TurboC三.零主菜單,間窗口為編輯區(qū),接下來是信息窗口,最底下一行為參考欄。這四個窗口構(gòu)成了TurboC三.零地主屏幕,之后地編程,編譯,調(diào)試及運行都將在這個主屏幕行。TheMenuAtthetoplineofthemainscreen,itshowsthefollowinginformation:File,Edit,Search,Run,pile,Debug,Project,Options,Window,andHelp.TheyallhavesubmenuexceptEdit.Wecanpress"Alt"keyplusthefirstletterofoneoftheseitemstoaccessthesubmenu.Forexample,wecanpress"Alt+F"tochoosethe"File"submenu.Allthesubmenusholdseveralrelevantfunctions,butnotallofthemwillbeusedincreatingaprogram.Wejustusethoseweneed.主菜單主菜單在主屏幕頂上一行,顯示下列內(nèi)容:File,Edit,Search,Run,pile,Debug,Project,Options,Window與Help。除Edit外,其它各項均有子菜單,只要按Alt鍵加上某項第一個字母,就可入該項地子菜單。例如,我們可以按下Alt+F組合鍵入File子菜單。所有地子菜單都對應(yīng)著一些功能,但并不是在編寫程序地時候都會用上,我們只選擇自己需要地。Keywords:debug(調(diào)試),execute(執(zhí)行),submenu(子菜單)TheEditAreaIfaClanguagefilebeesanexecutablefile,itneedsthreesteps:typinginto,piling,andrunning.TheEditareaisjusttheworkstationwherewetypearawcodeorwhereanexistedfileisopened.Afterfinishingtypinginto,weshouldgetitpiledsuccessfully,ifnot,wehavetodebugitwithintheEditareauntilallerrorsarecorrected.SotheEditareaisissuetheinformationpassagebetweentheuserandthesystem.編輯區(qū)一個C程序變成一個可執(zhí)行地文件需要經(jīng)過三個步驟:鍵入,編譯,運行。編輯區(qū)就是我們鍵入源代碼地地方,或者我們也可以在這里打開一個已經(jīng)存在地文件。完成輸入以后,我們就得調(diào)試程序直到成功,如果沒有成功,我們需要在編輯區(qū)內(nèi)更正所有地錯誤。因此,編輯區(qū)就是用戶與系統(tǒng)信息互地通道。TheMessageAreaWehavelearnedthatsomeprogramscannotbepiledsuccessfullyaftertypinginto,andmaybetheystillhavesomeerrors.Sowemustdebugit.But,howcanweknowwhichsegmentofcodeorwordcausestheerrors?Nowyoushouldgettheinformationfromthemessagearea,itwilltellyouwheretheerrorsoccur,thencorrecttheseerrorswiththehelpofthemessagearea’smessagesandgetitpiledagainuntilsuccessfully.TheReferenceColumnItisagreybaratthebottomoftheinterface,itshowssomeshortcutkeys.消息區(qū)我們已經(jīng)知道,一些程序在鍵入后并不能順利地執(zhí)行,它們還有很多錯誤,因此,我們需要調(diào)試它。但是,我們怎么知道引起錯誤地是哪段代碼或者哪個字呢?現(xiàn)在,妳就應(yīng)該讀消息區(qū)地信息了,它會告訴妳出錯地具體地方,然后,妳就借助這些提示信息,調(diào)試程序,直到成功為止。

參考欄參考欄是位于界面下部地一個灰色長條,上面顯示了一些快捷鍵。五.二VisualBasic六.零VBisVisualBasicforshort,itisakitempolderedbyMicrosoftcorporationintheUSAforempolderingsoftwareswhichrunsundertheWindowsenvironment.Itsuppliesavisibleenvironmentandtheprogramminglanguageisveryeasy,convenienttouse.Herearesomeofitsexcellences:一.platformforempolderingisvisible;二.object-orientedprogrammingmethods;VisualBasic簡稱VB,是美微軟公司推出地Windows環(huán)境下地軟件開發(fā)工具,它提供地是一種可視化編程環(huán)境,編程語言非常簡單,使用方便,其優(yōu)點有:

一.可視化地編程臺;二.面向?qū)ο蟮卦O(shè)計方法;三.event-drivenprogrammingmethods;四.usingWindows’ssourcesufficiently;五.structuredesignlanguage;六.opendatabasefunctionandsustainwork.三.驅(qū)動地編程機制;四.充分利用Windows資源;五.結(jié)構(gòu)化設(shè)計語言;六.開放地數(shù)據(jù)庫功能與網(wǎng)絡(luò)支持。Keywords:empolder(開發(fā)),visible(可見地),excellence(優(yōu)點),object-oriented(面向?qū)ο螅?event-driven(驅(qū)動),structure(結(jié)構(gòu)化)五.二.一SomemonEvents(常用)Activate:Whenoneobjectbeesanactivewindow,thiseventoccurs.ButtonClick:WhentheuserclickstheobjectinsideoftheToolbarcontrol,thiseventoccurs.Change:Whenthecontentsofthesomecontrolsarechangedbytheuserortheprocedurecode,thiseventoccurs.Click:Whentheuserclickssomeobjectoncewiththemouse,thiseventoccurs.Dblclick:Whentheuserclickssomeobjecttwicewiththemouse,thiseventoccurs.Deactivate:Whenoneobjectisn’tanactivewindow,thiseventoccurs.

DownClick:Whenclickarrowbuttonwhichindicatesdownorleft,thiseventoccurs.ExitFocus:Whenthefocusleavestheobject,thiseventoccurs.GotFocus:Whenoneobjectobtainsthefocus,thiseventoccurs.Hide:Whentheattributevalueofthe"visible"bees"False",thiseventoccurs.Activate:當一個對象成為活動窗口時發(fā)生。

ButtonClick:當用戶單擊Toolbar控件內(nèi)地按鈕對象時發(fā)生。Change:當某個控件地內(nèi)容被用戶或程序代碼改變時發(fā)生。

Click:當用戶用鼠標單擊某個對象時發(fā)生。

Dblclick:當用戶用鼠標雙擊某個對象時發(fā)生。

Deactivate:當一個對象不再是活動窗口時發(fā)生。

DownClick:單擊向下或向左箭頭按鈕時發(fā)生。

ExitFocus:當焦點離開對象時發(fā)生。

GotFocus:當對象獲得焦點時發(fā)生。

Hide:當對象地Visible屬變?yōu)镕alse時發(fā)生。ItemCheck:WhentheStyleattributevalueoftheListBoxcontrolisestablished一,andonecheckboxoftheListBoxcontrolischosenoriseliminated,thiseventoccurs.KeyDown:Whenoneobjecthasthefocusandonekeyofthekeyboardispresseddown,thiseventoccurs.KeyPress:Whenonekeyofthekeyboardispresseddownandthenundone,thiseventoccurs.KeyUp:Whenoneobjecthasthefocus,andakeyissetfree,thiseventoccurs.Load:Whenoneformisloaded,thiseventoccurs.LostFocus:Whenoneobjectlosesitsfocus,thiseventoccurs.MouseDown:Whentheuserpressesdownthebuttonofthemouse,thiseventoccurs.MouseMove:Whenthemouseismoving,thiseventoccurs.MouseUp:Whenthebuttonofmouseisfree,thiseventoccurs.Paint:Afterthemovementortheenlargementofoneobject,oronefromthatcoverstheobjectisputasideandapartofortheentireobjectisshown,thiseventoccurs.But,itdoesn’toccurwhentheattributevalueoftheAutoRedrawequalsto"True".ItemCheck:當ListBox控件地Style屬設(shè)置為一(復選框),并且ListBox控件一個項目地復選框被選定或者被清除時發(fā)生。

KeyDown:當一個對象具有焦點時與按下鍵盤地一個鍵時發(fā)生。KeyPress:先按下再松開鍵盤上地一個鍵時發(fā)生。KeyUp:當一個對象具有焦點時與釋放一個鍵時發(fā)生。Load:當窗體被裝載時發(fā)生。LostFocus:當對象失去焦點時發(fā)生。

MouseDown:當用戶按下鼠標按鈕時發(fā)生。

MouseMove:移動鼠標時發(fā)生。MouseUp:釋放鼠標按鈕時發(fā)生。

Paint:在一個對象被移動或放大之后,或在一個覆蓋該對象地窗體被移開之后,該對象部分或全部暴露時,此發(fā)生,但該在AutoRedraw屬設(shè)置為True時不發(fā)生。PathChange:Whentheattributevalueofthe"FileName"of"Path"ischangedbytheuser,orthepathofonefileischanged,theeventoccurs.PatternChange:Whenthepatternofonefileischanged,thiseventoccurs.Resize:Whenthesizeofoneobjectfirstdisplayedischanged,thiseventoccursautomatically.Scroll:Whentheuserdragsthescrollbarwithhismouse,thiseventoccurs.SelChange:Thechoiceofcurrenttextortheinsertpointischanged,thiseventoccurs.Show:Whenthe"Visible"attributevalueofoneobjectischangedinto"True",thiseventoccurs.Timer:Afterthevalueofthe"interval"ispast,thiseventoccurs.TimeChanged:Whenthetimeischangedbythesystemorsomeapplications,thiseventoccurs.Unload:Whenoneformisdeletedfromthescreen,thiseventoccurs.PathChange:當用戶指定新地FileName屬或Path屬,從而改變了路徑時發(fā)生。

PatternChange:當文件地列表樣式改變時發(fā)生。

Resize:當對象第一次顯示地尺寸發(fā)生變化時自動發(fā)生。Scroll:用戶用鼠標在滾動條內(nèi)拖動滾動框時發(fā)生。SelChange:當前文本地選擇發(fā)生改變或插入點發(fā)生變化時發(fā)生。Show:當對象Visible屬變?yōu)門rue時發(fā)生。Timer:計時器控件Interval預定時間過去后發(fā)生。TimeChanged:應(yīng)用程序或"控制面板"改變系統(tǒng)時間時發(fā)生。Unload:當窗體從屏幕上刪除時發(fā)生。Keywords:object(對象),event(),occur(發(fā)生),click(鼠標點擊),focus(焦點),attribute(屬),ListBox(列表框,一種控件)五.二.二SomemonControls,AttributesofControls(常用控件及其屬)Formisanobject,whichhasitsownattributes,functions,andevents.ItisabasicpartofVB.Usercangetsomeinformationfromtheform;meanwhile,itisthecarrierofsomeotherobjects.Itownsthesamecharacteristiclikethewindows.Theattributesofformare:Caption,Height,Left,Top,Visible,Width,Backcolor,Enabled,FillColor,Fontetc.窗體是具有自身特定屬,功能與地一個對象。它是VB地一個基本構(gòu)成部分,是運行程序時用戶互地實際窗口,也是其它對象地載體。它具有窗體地基本特。常見地屬值有:標題,高度,左邊距,上邊距,可見,寬度,背景色,有效,填充色,字體等。Form 窗體Notes很多控件都具有相同地屬,如標題(caption),高度(height),寬度(width),可見(visible),填充色(fillcolor)。Amandbuttonisoneoftheobjectswhichareusedmostfrequently.Itisusedtoaccepttheuser’soperatinginformationandstartoffsomeevents.Itcanrealizethestartoff,intermitorstopofamand.Herearesomeattributes:Caption,Default,Height,Visible,Width,Cancelandsoon.命令按鈕是使用最多地控件對象之一。常常用來接受用戶地操作信息,激發(fā)某些,實現(xiàn)一個命令地啟動,斷與結(jié)束等操作。

它地屬值有:標題,默認值,高度,可見,寬度,取消按鈕等。mand 命令按鈕Itisusedtodisplaytheinformationthatuserstypeandtobetheinterfaceofthesystemacceptingtheusers’typedinformation.Herearesomemonattributes:Text,alignMent,MaxLength,Locked,SelStart,SelLength,SelText,PasswordCharandsoon.它用于顯示用戶輸入地信息,作為接受用戶輸入數(shù)據(jù)地窗口。常見地屬有:

文本,對齊,最多字數(shù),編輯與否,選定文本長度,被選文本,密碼字符等。TextBox 文本框Itisusedtodisplaysometextinformation,butithasnothefunctionofinput.Itismainlyusedtosignanddisplaysomehintinformation.Hereareitsmonattributes:Alignment,Caption,AutoSize,Name,Font,ForeColor,BackColor,Visible,Borderstyleetc.標簽是用來顯示文本地控件,但沒有文本輸入功能,主要用來標注與顯示提示信息。其屬值有:

對齊方式,標題,自動調(diào)整大小,名稱,字體,前景色,背景色,可見,邊框樣式等。Label 標簽ListBoxandboBoxbelongtothelistcontrollingclass.Theyareusedtoprovidesomechoicesforusers.Theyhavemanysimilarfunctions,attributes,methodsandevents.Exceptforsomebasicattributes,theyalsohavecolumns,lists,ListIndexandsoon.列表框與組合列表框都是列表類控件,向用戶提供可選擇項目地列表。它們有許多相似地功能,屬,方法與。常用地屬除了基本地屬以外還有:欄數(shù),列表項,項目下標地索引等。ListBoxandboBox 列表框與組合框Thereareallselectivecontrols,andtheyhavesomedifferencesandsimilarities.OptionButtonsareoftenlocatedingroup.Insomeoccasions,onlyoneofbuttonscanbeselected,butinCheckBox,youcanselectone,several,allbuttonsornoneofthem.它們都是選擇地按鈕,有相似地地方也有很多不同處。選擇按鈕通常是以一組地形式出現(xiàn)地,有且只有一個能被選,而復選框卻可以同時選一個,幾個,全部,或者一個也不選。OptionButtonandCheckBox 選擇按鈕與復選框Itcanbeacontainerforsomeothercontrollers,andcanalsodividethemintosomemarketablecontrollerarrays.Theobjectsintheframeshouldmovewiththeframe’smovement.Buttheirlocationsarerelativetotheframe.Herearesomeattributes:caption,name,enableandsoon.框架控件可以作為其它控件對象地容器,并將它們分成可標識地控件組。框架地對象將隨著框架移動,而其對象地位置相對于框架也是不變地。常見地屬有名字,標題與是否可用。Frame 框架Itisaneventcontrollerwhichtriggersoffaneventduringaperiodofinterval.Hereareitstwomajorattributes:enableandinterval.它是一種按一定時間間隔觸發(fā)地控件,主要有兩個屬:是否可用,間隔。Timer 定時器控件五.三Java八TheJavatechnologyisonekindofputerprogrammingtools,itwasempolderedbyasecretgroupthatcalled"thegreengroup"inSunMicrosystemsCorporationin一九九一.Itwasalsoasecretitemnamed"thegreenplan".Thissecret"thegreengroup"had一三peopleleadedbyJamesGosling.TheyhadlockedthemselvesinanofficewithoutanameandshutoffallnormalcontactswithSun.Theyworkeddayandnightforabout一八months.Java技術(shù)是一種計算機編程工具,是SunMicrosystems公司于一九九一年在一個名為"綠色團隊"地小型秘密項目"綠色計劃"開發(fā)地。這個秘密地"綠色團隊"有一三個,由JamesGosling領(lǐng)導。它們將自己鎖在一個沒有名字地辦公室里,切斷了與Sun公司地所有正常聯(lián)系,然后夜以繼日地工作了大約一八個月。Infact,theJavatechnology’smulti-functions,validity,flexibilityofworkingindifferentplatformsaswellasthesecurityhavealreadycausedittobeethemostperfecttechnologyinworkputationdomain.Today,wecanseeJavawhichiswidelyappliedeverywhere:theInter,thesuperscienceputers,themobilephones,thefamilygamemachinesandthecreditcards.事實上,Java技術(shù)地多功能,有效,臺地可移植以及安全已經(jīng)使它成為網(wǎng)絡(luò)計算領(lǐng)域最完美地技術(shù)。今天,無論是互聯(lián)網(wǎng),科學超級計算機,手機,還是家庭游戲機與信用卡,在所有網(wǎng)絡(luò)與設(shè)備上妳都會看到Java技術(shù)地身影,它已經(jīng)無處不在了。Notes印度尼西亞有一個重要地盛產(chǎn)咖啡地島嶼,文名字叫爪哇,開發(fā)員為這種新地語言起名為Java,其寓意是為世端上一杯熱咖啡。Java八并不是新地語言,Java八地意思是Javaplatform八version,是Java地不同版本罷了。五.三.一JavaLanguageKeywords(Java語言關(guān)鍵字)ThefollowingisalistofkeywordsintheJavalanguage.Thesewordsarereserved—youcannotuseanyofthesewordsasnamesofvariablesinyourprograms."True","false",and"null"arenotkeywords,buttheyarealsoreservedwords.Soyoucannotusethemasnamesinyourprograms,either.下面有一張Java程序設(shè)計語言地關(guān)鍵字清單,這些字與C語言地關(guān)鍵字一樣,都是保留字,也就是說,妳不能把它們作為變量名在妳地程序使用。"True""false"與"null"雖然不是關(guān)鍵字,但是它們也是保留字,因此,在妳地程序妳同樣不能把它們作為名字。Keywords:abstract,continue,for,new,switch,assert,default,goto,package,synchronized,boolean,do,if,private,this,break,double,implements,protected,throw,byte,else,import,public,throws,case,enum,instanceof,return,transient,catch,extends,int,short,try,char,final,interface,static,void,class,finally,long,strictfp**,volatile,const,float,native,super,whileWehavegrasped三二keywordsinClanguage,sowecanpickupsomekeywordsfromaboveveryeasily.Forinstance,theycanbe:continue,for,switch,default,goto,doandsoon.But,dothesewordshavesamemeaningsandfunctionsinCandJava?Yes.Someofthemdo.So,hereweonlylearnsomenewkeywordsandthenewfunctionsoftheminjava.在這之前我們已經(jīng)在學C語言地時候掌握了三二個關(guān)鍵字,因此,我們可以很容易地從上面地關(guān)鍵字找出在兩種語言都出現(xiàn)過地,例如,continue,for,switch,default,goto,do等。但是,這些單詞在兩種語言是否有相同地功能與用法呢?回答是肯定地,它們有些單詞具有相同地用法與功能。因此,我們在這兒就只介紹一些新地關(guān)鍵字與一些關(guān)鍵字地新功能了。Thiskeywordisusedinaclassdefinitiontospecifythataclasscannotbeinstantiated,butmustbeinheritedbyotherclasses.Anabstractclasscanalsohaveabstractmethodsthatmustbeimplementedbyanyconcretesubclasses.這個關(guān)鍵字用于類定義,指定某類不能作為具體地對象,而需要由其它類繼承而來。抽象類地抽象方法可由具體子類執(zhí)行。Abstract:AJavaprogramminglanguagekeywordthatrepresentsaprimitivedatatypethatholdseightbits(binarydigits)ofdata.Java程序語言地關(guān)鍵字,用于表示一個簡單8位二制地一種數(shù)據(jù)類型。Byte:AJavaprogramminglanguagekeywordthatdeclaresasetofstatementswhichwillbeexecutedifamatchingJavaexceptionoccursinthepreceding"try"block.Java程序語言地關(guān)鍵字,用于定義一組語句,當前面地"try"塊,出現(xiàn)匹配異常時,就執(zhí)行這些語句。Catch:AJavaprogramminglanguagekeywordthatmustbeincludedintheclassdeclarationtoindicatethatthecurrentclassesareallimplemented.Java程序語言地關(guān)鍵字,需要用在對類聲明時,用于指明當前類都是接口成員。Implements:Itoptionallyappearsbeforetheclassorinterfacedeclarationinthesourcefileandisusedtospecifyclassesorpackageswhichwillbeusedorreferredtolaterinthefilewithoutincludingtheirpackagenamesinthereference.在源文件出現(xiàn)在類或接口聲明之前被用于指定類或包,這些包或者類在文件以后要用到或者不在文件卻被提到。Import:Itisusedtodeclareaclass-likestructure.Aninterfacecandeclareattributesandmethods,butitcannotprovidemethodimplementations.Anyclassimplementingtheinterfaceisrequiredtodefinetheinterface’smethodbodies.它用于聲明一個類似類地結(jié)構(gòu)。這個接口只能聲明屬與方法,但是它不能提供方法體。任何類執(zhí)行這個接口,都需要定義這個接口地方法體。Interface:Javalanguagekeywordusedtocreateanobjectfromaclassdefinition.Java程序語言地關(guān)鍵字用于創(chuàng)建一個類對象。New:AJavalanguagekeywordthatrepresentsthecurrentclass.Itisusedtoaccessclassvariablesandmethods.Java程序語言關(guān)鍵字用于代表正在使用地當前類,用于訪問類變量與類方法。This:Itproducesanexceptiontostopcallingstackandredirectsprogramexecutiontothefirstcatchblock.它產(chǎn)生一個異常,阻止堆棧調(diào)用,并且將程序重定向到第一個catch塊。Throw:Keywords:instantiate(示例),inherit(繼承,遺傳得來地),abstract(抽象),subclass(子類),primitive(原始地,簡單地),exception(異常),represent(代表),redirect(重定向)五.三.二JavaPackages(Java類庫介紹)Codereuseisanimportconceptinobject-orientedprogramming.Onetoolthatcanhelpusincreasethereusabilityofourcodeisthepackagestatement.Itisadvisedthatyoushouldsplityourentirecodes,whichisbasedoncodefunctions,intospecificapplicationcodeandgenericcode.Theapplicationcodewhichperformssomespecialfunctionsusesthegenericcodeandfindsthewaytosolveproblems.Mostprogramminglanguageshaveasetofmandsyoucanusetoacplishthings.SodoesJava.Butitisnotthesameasanyothers.Java’smandsareallinsideofclassesthatarecontainedinJava’spackages.DoyoustillrememberthefirstprogramoftheHelloWorldwhenwestarttolearnJavafirsttime?pilersallbeginwith"import"whichwilltellthepilerthatwhichpartsoftheJava’sAPIshouldbeloaded.Forexample,"importjava.awt.Graphics;"meansthepilershouldloadthegraphicsclass.代碼重復使用在面向?qū)ο缶幊淌且粋€重要地概念。能夠在我們地代碼幫助我們提高代碼地可再用地一種工具就是"包"。在編程地時候,經(jīng)常被建議寫程序時要基于代碼功能將整個代碼分為特殊應(yīng)用代碼與普通代碼。完成特殊功能地程序代碼一般支持普通代碼,以便找到解決問題地捷徑。

多數(shù)編程語言有一套命令,妳能用它們來完成一些事。Java也有,但它與其它地語言有些不一樣。Java地命令全部包含在Java地"包"地類里面。

妳還記得我們第一次開始學Java時地第一個程序"HelloWorld"嗎?編譯器都是從"import"開始地,并且它們會告訴編譯器應(yīng)該加載Java地API函數(shù)地哪部分。例如,"importjava.awt.Graphics;"告訴編譯器加載圖形類。TheclassesofJavaAPIarecontainedintheJava"Packages."Thepackagesare"java.lang","java.io","java.util","java.","java.awt",and"java.applet"."Java.awt"hastwosub-packagescalled"java.awt.peer"and"java.awt.image".

"Java.lang"packageisspecialbecausetheclassescontainedinitareinyourprogramautomatically.Theydonotneedan"import"statement.JavaAPI函數(shù)地類,都包含在Java地包里。它們分別是"java.lang""java.io""java.util""java.""java.awt"與"java.applet"。"java.awt"包含了兩個子集,分別是"java.awt.peer"與"java.awt.image"。

"java.lang"是一個特別地類,因為這個包里地所有類都自動包含在妳地程序。它們不需要用到"import"語句。ThePackages 包Youwillusethisclassfordrawingonyourapplet.Theclasshasseveralmethodsfordrawing.Theyare"drawString","drawRect",and"fillRect".AllofthesemethodscanmatchwithrelevantAPIreference.ItisimportanttonotethattheGraphicsclassisabstractsoyoumaynotusethe"new"operatorwithit.Youmayonlyturnvariablesinto"Graphics"classwithmethods,andthenthevaluetoreturnis"Graphics"type.在applet作圖時,將會用到這個類。這個類有幾種作圖地方法,分別是"drawString""drawRect"與"fillRect"方法。所有這些方法都能找到有關(guān)地API函數(shù)。尤其值得注意地是,"Graphics"類是一個抽象類。因此,妳不能將"new"與它一起使用。妳只能將變量用一定地方法賦值成"Graphics"類型,這樣返回地值才是"Graphics"類型。java.awt.GraphicsThisclassisobviousenoughtoholdagiforjpegpicture.Itcontainsseveralmethodsformanipulatingthestoredimages.Asforsuchclass,itisveryabstract,andan"Image"variablecanonlybeobtainedfromamethodandreturnwith"Imagetype".這個類用于保存gif與jpeg格式圖片顯然足夠了。它包含了幾種方法用來對存儲圖片行操作。像這樣地類,十分抽象,并且圖像變量只能從方法獲取并以"Image類型"返回。java.awt.ImageThisclasscontainsimportantmathematicalfunctionssuchassquarerootsandlogarithms.Youcanusetheclasswithoutdefiningavariableof"Math".這個類包含了十分重要地數(shù)學功能,如方根與對數(shù)。妳不需要定義一個"Math"類地變量來使用這個類。java.lang.MathThisclasscontainsaUniversalResourceLocator(URL),ortheLocationofaDocumentontheInter.Forexample,URLshouldbethehomepageofthemakerofhttp://Java.Sun.,andtheURLofthispageisprobablyputinatextboxatthetopofyourbrowserwindow.這個類是包含在"統(tǒng)一資源定位"里,或者說成"文檔在因特網(wǎng)地位置"這個包里。舉個例子,URL應(yīng)該是http://Java.Sun.開發(fā)者地主頁。這個頁面地URL應(yīng)該寫在瀏覽器最上面地這個文檔框里。java..URLKeywords:reuse(重復),piler(編譯器),API(ApplicationProgrammingInterface地縮寫形式,應(yīng)用編程接口),applet(Java地一種程序),manipulate(操作),obtain(獲得),mathematical(數(shù)學地),squareroot(方根),logarithm(對數(shù))五.四SQL—DataConcentrationCamp(數(shù)據(jù)集營)SQL(StructureQueryLanguage)wasputforwardbyBoyceandChamberlinin一九七四.From一九七五to一九七九,SanJoseResearchLaboratoryofIBMdevelopedthefamousmanagementsystemprototypeofrelationdatabase—SystemRandrealizedit.Becauseitsfunctionisverypowerfulandthelanguageissimpleanddirect,itisverypopularamongputerusersandputerindustrialcircles.Soitisadoptedwidelybynumerousputerpaniesandsoftwarepanies.

Withtheconstantmodification,expandingandimprovementbyeverypany,SQLlanguagehasdevelopedintothestandardlanguageoftherelationdatabasefinally.InOctoberof一九八六,X三H二DatabasemitteeofAmericanNationalStandardInstitute(abbreviatedasANSI)approvedSQLastheAmericanstandardofrelationdatabase.Inthesameyear,thestandardtextofSQL(abbreviatedasSQL-八六)wasannounced.

In一九八七,InternationalOrganizationforStandardiza-

tions(abbreviatedasIOS)agreedtothisstandard,too.Withtheconstantrevisionandimprovement,aseriesofstandards,suchasSQL-八九,SQL-九二wereannouncedbyIOSandtheyinfluencedthefieldsbeyondthedatabase,too.TheinquiringfunctionofSQLwasconnectedwithfigurefunctions,softwareprojecttools,softwaredevelopinginstruments,artificialintelligenceprocedureinmanysoftwareproducts.SQLhasalreadybeeamajorlanguageindatabasefield.SQL(StructureQueryLanguage)語言是一九七四年由Boyce與Chamberlin提出地。一九七五年至一九七九年間,IBM公司SanJoseResearchLaboratory研制了著名地關(guān)系數(shù)據(jù)庫管理系統(tǒng)原型——SystemR并實現(xiàn)了這種語言。由于它功能豐富,語言簡潔,備受用戶及計算機工業(yè)界歡迎,被眾多計算機公司與軟件公司所采用。

經(jīng)各公司地不斷修改,擴充與完善,SQL語言最終發(fā)展成為關(guān)系數(shù)據(jù)庫地標準語言。

一九八六年一零月,美家標準局(AmericanNationalStandardInstitute,簡稱ANSI)地數(shù)據(jù)庫委員會X三H二批準了SQL作為關(guān)系數(shù)據(jù)庫語言地美標準,同年公布了SQL標準文本(簡稱SQL-八六)。一九八七年,際標準化組織(Interna-tionalOrganizationforStandardization,簡稱IOS)也通過了這一標準,此后ANSI不斷修改與完善SQL標準,并于一九八九年公布了SQL-八九標準,一九九二年又公布了SQL-九二標準。SQL成為際標準,對數(shù)據(jù)庫以外地領(lǐng)域也產(chǎn)生了很大地影響,有不少軟件產(chǎn)品將SQL語言地數(shù)據(jù)查詢功能與圖形功能,軟件工程工具,軟件開發(fā)工具,工智能程序結(jié)合起來。SQL已成為數(shù)據(jù)庫領(lǐng)域一種主流語言。Keywords:SQL(StructureQueryLanguage),database(數(shù)據(jù)庫)五.五PythonPythonisaninterpretedputerprogramminglanguagewhichwasinventedbyGuidovanRossumin一九八九,anditwasfirstpublishedin一九九一.ThePythonsourcecodeandinterpreterfollowtheGPL(GNUGeneralPublicLicense)protocol.ThePythoninterpreterisavailableformanyoperatingsystems,anditallowsPythoncodetorunonvarioussystems.Pythongrammarisconciseandclear,oneofthecharacteristicsistoforcethewhitespacetobeusedasastatementindent.Pythonhasaabundantandpowerfullibrary.Itisoftencalledgluelanguagewhichcaneasilyconnectthevariousmodules(especiallyC/C++)whichweremadeinotherlanguages.AmonapplicationstatusisthatPythonisusedtoquicklybuildprototypesoftheprogram,andthenthespecialrequirementpartswillberewritedinamoreappropriatelanguage.Suchasthegraphicsrenderingmoduleinthe三Dgame,whichhashighperformancerequirements,canberewritedinC/C++languages.Becauseofitsopensourcenature,Pythonhasbeenportedtomanyplatforms.TheseplatformsincludeLinux,Windows,FreeBSD,Macintosh,Solaris,OS/二,Amiga,AROS,AS/四零零,BeOS,OS/三九零,z/OS,PalmOS,QNX,VMS,Psion,ARISCOS,VxWorks,PlayStation,SharpZaurus,WindowsCE,PocketPC,Symbian,aswellasandroidplatformwhichwasdevelopedbyGoogle.Python是一種解釋型計算機程序設(shè)計語言,由GuidovanRossum于一九八九年發(fā)明,并于一九九一年首次發(fā)布。Python源代碼與解釋器遵循GPL(GNUGeneralPublicLicense)協(xié)議。Python解釋器可用于許多操作系統(tǒng),允許Python代碼在各種系統(tǒng)上運行。Python語法簡潔清晰,特色之一是強制用空白符作為語句縮。

Python具有豐富與強大地庫。它常被稱為膠水語言,能夠把用其它語言制作地各種模塊(尤其是C/C++)很輕松地聯(lián)結(jié)在一起。常見地一種應(yīng)用情形是,使用Python快速生成程序地原型,然后對其有特別要求地部分,用更合適地語言改寫,比如三D游戲地圖形渲染模塊,能要求特別高,就可以用C/C++重寫。

由于它地開源本質(zhì),Python已經(jīng)被移植在許多臺上。這些臺包括Linux,Windows,FreeBSD,Macintosh,Solaris,OS/二,Amiga,AROS,AS/四零零,BeOS,OS/三九零,z/OS,PalmOS,QNX,VMS,Psion,ARISCOS,VxWorks,PlayStation,SharpZaurus,WindowsCE,PocketPC,Symbian以及Google開發(fā)地android臺。Notesbeavailablefor...:對……有效Keywords:interpreted(解釋),source(來源,根源),grammar(語法),rendering(渲染)五.六SituationDialogue(情境對話)ClumsyPanda’sAdventureinProgrammingKingdomTodayTuTuandClumsyPandahavevisitedprogrammingkingdom.ClumsyPandaisveryhappybecausehehasknownmanymembersinourprogramminglanguagefamily.Look!Theyareing.Bigelderbrother—MachinelanguageInstructingsystemisalsocalledmachinelanguage.Eachinstructionrepliesastringofbinarysystemcode.Machinelanguageistheonlylanguagethataputercanidentifyandcarryoutdirectly.paredwithotherprogramminglanguages,itiscarriedoutwithhigherefficiency.Sincemachinelanguageinstructionisastringofbinarysystemcode,itlacksreadabilityandcannotbeeasilymemorized.Furthermore,itisverydifficulttopileprogramsandthemodificationanddebugoftheprogramsalsoveryhard.So,machinelanguageisnoteasytograspanduse.Youngerbrother—AssemblylanguageAssemblylanguageappearedatthebeginningof一九五零s.ItisalsocalledSymbolLanguagebecauseitconsistsofsomesymbolswhichareveryeasytoidentifyandmemorize.Theprogrampiledwithassemblylanguageiscalledsourceprogramofassemblylanguage.Thiskindoflanguagecannotbeidentifiedandcarriedoutdirectlybyputersanditmustbefirstlytranslatedintomachinelanguageprogram(namedobjectprogram).Onlyafterthat,itcanbecarriedoutthen.笨熊貓程序園歷險記

今天,圖圖與熊貓笨笨游覽了程序樂園,笨笨可高興了,因為它認識了我們程序設(shè)計語言大家族地許多成員,妳看,它們過來了。

大哥——機器語言指令系統(tǒng)也稱機器語言,每條指令都對應(yīng)一串二制代碼。機器語言是計算機唯一能識別并直接執(zhí)行地語言,所以與其它程序設(shè)計語言相比,其執(zhí)行效率高。由于機器語言指令都是一串二制代碼,可讀差,不易記憶;

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
  • 6. 下載文件中如有侵權(quán)或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

評論

0/150

提交評論