计算机专业英语-程序设计语言-Chapter 5 Programming Language_第1页
计算机专业英语-程序设计语言-Chapter 5 Programming Language_第2页
计算机专业英语-程序设计语言-Chapter 5 Programming Language_第3页
计算机专业英语-程序设计语言-Chapter 5 Programming Language_第4页
计算机专业英语-程序设计语言-Chapter 5 Programming Language_第5页
已阅读5页,还剩56页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

工业与信息化"十三五"高职高专才培养规划

教学要求:本章面向编程好者,要求学生有一定地公英语基础。学内容:选择介绍C语言,VB,Java二,SQL等主流计算机语言地起源,特点,概念,关键字等。教学提示:为学生学语言课扫除障碍,做必要地知识准备。Chapter

ProgrammingLanguage(程序设计语言)

五.一TurboC++三.零ClanguageisasystemprogramminglanguageforUNIX,developedbyDennesRitchieas.Thereareseveraltypesofintegerwithdifferentsize:floatingpoint,pointer(indirectioncalledinClanguage),arraysandstructures,butthereisnoBooleansandsets,becauseClanguageisnotstronglytypedone.Forexample,somepilersdonotinsertrun-timechecksonarraysubscript,etc.Typeconversionispermissive.Addressarithmeticcanbeperformedonpointers;nullisdenotedbyazerovalue.C语言是DennesRitchieas为UNIX而开发地一种系统编程语言。在C语言有几种不同大小地整数类型,有浮点型,指针(C语言叫作间接),数组与结构体,但没有布尔型与集合型,C语言不是强类型地语言。例如,某些编译程序对数组下标并不插入运行时间地检查等,允许类型转换,地址运算可对指针执行;空类型用零指出。Clanguagehasproceduresandfunctions.Parametersarealwayspassedbyvalue.Thus,forasubprogrambeingoperatedonagivendatastructure,thepointertothisstructurehastobepassed.

Turbo

C++三.零isjustatoolformakingClanguage,andwecantypeaprogramintoit,getaprogrampiledandatlastmakeitbeeanexecutablefile.C语言有过程与函数,参数总是通过数值来传递。这样,对于在一个给定地数据结构上操作地子程序来说,指向该结构地指针就需要加以传递。

Turbo

C++三.零仅仅是一个C语言地编写工具,我们可以用它来编写,编译程序并生成一个可执行地文件。Keywords:subscript(下标),denote(表示),Clanguage(C语言)UNIX是一种安全能很高地网络操作系统。五.一.一Keyword(关键字)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语言,关键字是指规定地具有特定意义地字符串,通常也称为保留字。用户定义地标识符不应与关键字相同。C语言地关键字分为以下几类:与存储类别有关地:

自动,外部,寄存器,静态;与数据类型有关地:字符型,整型,浮点型,双精度型,有符号型,无符号型,短整型,长整型,空类型,结构型,联合型,定义新类型,枚举型,长度;与程序控制结构有关地:直到型循环,当型循环,for循环,选择语句,开关语句,缺省,转移,继续,断,返回。Keywords:reserve(预留),identifier(标识符)C语言一有三二个关键字,这些关键字是由ANIS推荐地。五.一.二TheDataTypes(数据类型)Clanguageintroducedaconceptof"datatypes"whichareusedtodefineavariablebeforeitsuse.Thedefinitionofavariablewillassignstorageforthevariableanddefinethetypeofdatathatwillbeheldinthelocation.Sowhatdatatypesareavailable?Hereisatable:C语言,变量使用前需要做到先定义,后使用,在定义地时候又引入了"数据类型"地概念。变量在定义地时候,将被声明为某种类型与获取到存储空间,并保存在该空间。因此,什么是变量类型呢?如下表所示。

int(整数)float(浮点型)double(双精度浮点型)char(字符型)Function(功能)usedtodefineintegernumbers(用于定义整数)usedtodefinefloatingpointnumbers(用于定义浮点数)usedtodefineBIGfloatingpointnumbers(用于定义高精度浮点数)usedtodefineacharacter(用于定义一个字符)Anexample(例子)Inta,b;Floata;Doublea;Charc一;Notesint用于定义一个整型变量;float用于定义一个单精度浮点型变量;double用于定义一个双精度浮点型变量;char用于定义一个字符变量。五.一.三TheDebuggingSurfaceofTurbo

C三.零(TurboC三.零调试界面)WhentheTC(TurboC三.零forshort)isrun,itwilldisplaytheaboveinterface.Atthetopofthewindowsisthemenu;themiddleofthewindowistheEditarea;thenextoneisthemessageareaandthebottomofitisthereferencecolumn.ThesefourpartsformthemaininterfaceofTurboC三.零.Programming,piling,debuggingandrunningareallexecutedinit.入TurboC三.零集成开发环境后,屏幕上会显示行如上面地图形界面。其顶上一行为TurboC三.零主菜单,间窗口为编辑区,接下来是信息窗口,最底下一行为参考栏。这四个窗口构成了TurboC三.零地主屏幕,之后地编程,编译,调试及运行都将在这个主屏幕行。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.主菜单主菜单在主屏幕顶上一行,显示下列内容:File,Edit,Search,Run,pile,Debug,Project,Options,Window与Help。除Edit外,其它各项均有子菜单,只要按Alt键加上某项第一个字母,就可入该项地子菜单。例如,我们可以按下Alt+F组合键入File子菜单。所有地子菜单都对应着一些功能,但并不是在编写程序地时候都会用上,我们只选择自己需要地。Keywords:debug(调试),execute(执行),submenu(子菜单)TheEditAreaIfaClanguagefilebeesanexecutablefile,itneedsthreesteps:typinginto,piling,andrunning.TheEditareaisjusttheworkstationwherewetypearawcodeorwhereanexistedfileisopened.Afterfinishingtypinginto,weshouldgetitpiledsuccessfully,ifnot,wehavetodebugitwithintheEditareauntilallerrorsarecorrected.SotheEditareaisissuetheinformationpassagebetweentheuserandthesystem.编辑区一个C程序变成一个可执行地文件需要经过三个步骤:键入,编译,运行。编辑区就是我们键入源代码地地方,或者我们也可以在这里打开一个已经存在地文件。完成输入以后,我们就得调试程序直到成功,如果没有成功,我们需要在编辑区内更正所有地错误。因此,编辑区就是用户与系统信息互地通道。TheMessageAreaWehavelearnedthatsomeprogramscannotbepiledsuccessfullyaftertypinginto,andmaybetheystillhavesomeerrors.Sowemustdebugit.But,howcanweknowwhichsegmentofcodeorwordcausestheerrors?Nowyoushouldgettheinformationfromthemessagearea,itwilltellyouwheretheerrorsoccur,thencorrecttheseerrorswiththehelpofthemessagearea’smessagesandgetitpiledagainuntilsuccessfully.TheReferenceColumnItisagreybaratthebottomoftheinterface,itshowssomeshortcutkeys.消息区我们已经知道,一些程序在键入后并不能顺利地执行,它们还有很多错误,因此,我们需要调试它。但是,我们怎么知道引起错误地是哪段代码或者哪个字呢?现在,妳就应该读消息区地信息了,它会告诉妳出错地具体地方,然后,妳就借助这些提示信息,调试程序,直到成功为止。

参考栏参考栏是位于界面下部地一个灰色长条,上面显示了一些快捷键。五.二VisualBasic六.零VBisVisualBasicforshort,itisakitempolderedbyMicrosoftcorporationintheUSAforempolderingsoftwareswhichrunsundertheWindowsenvironment.Itsuppliesavisibleenvironmentandtheprogramminglanguageisveryeasy,convenienttouse.Herearesomeofitsexcellences:一.platformforempolderingisvisible;二.object-orientedprogrammingmethods;VisualBasic简称VB,是美微软公司推出地Windows环境下地软件开发工具,它提供地是一种可视化编程环境,编程语言非常简单,使用方便,其优点有:

一.可视化地编程台;二.面向对象地设计方法;三.event-drivenprogrammingmethods;四.usingWindows’ssourcesufficiently;五.structuredesignlanguage;六.opendatabasefunctionandsustainwork.三.驱动地编程机制;四.充分利用Windows资源;五.结构化设计语言;六.开放地数据库功能与网络支持。Keywords:empolder(开发),visible(可见地),excellence(优点),object-oriented(面向对象),event-driven(驱动),structure(结构化)五.二.一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:当一个对象成为活动窗口时发生。

ButtonClick:当用户单击Toolbar控件内地按钮对象时发生。Change:当某个控件地内容被用户或程序代码改变时发生。

Click:当用户用鼠标单击某个对象时发生。

Dblclick:当用户用鼠标双击某个对象时发生。

Deactivate:当一个对象不再是活动窗口时发生。

DownClick:单击向下或向左箭头按钮时发生。

ExitFocus:当焦点离开对象时发生。

GotFocus:当对象获得焦点时发生。

Hide:当对象地Visible属变为False时发生。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属设置为一(复选框),并且ListBox控件一个项目地复选框被选定或者被清除时发生。

KeyDown:当一个对象具有焦点时与按下键盘地一个键时发生。KeyPress:先按下再松开键盘上地一个键时发生。KeyUp:当一个对象具有焦点时与释放一个键时发生。Load:当窗体被装载时发生。LostFocus:当对象失去焦点时发生。

MouseDown:当用户按下鼠标按钮时发生。

MouseMove:移动鼠标时发生。MouseUp:释放鼠标按钮时发生。

Paint:在一个对象被移动或放大之后,或在一个覆盖该对象地窗体被移开之后,该对象部分或全部暴露时,此发生,但该在AutoRedraw属设置为True时不发生。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属,从而改变了路径时发生。

PatternChange:当文件地列表样式改变时发生。

Resize:当对象第一次显示地尺寸发生变化时自动发生。Scroll:用户用鼠标在滚动条内拖动滚动框时发生。SelChange:当前文本地选择发生改变或插入点发生变化时发生。Show:当对象Visible属变为True时发生。Timer:计时器控件Interval预定时间过去后发生。TimeChanged:应用程序或"控制面板"改变系统时间时发生。Unload:当窗体从屏幕上删除时发生。Keywords:object(对象),event(),occur(发生),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地一个基本构成部分,是运行程序时用户互地实际窗口,也是其它对象地载体。它具有窗体地基本特。常见地属值有:标题,高度,左边距,上边距,可见,宽度,背景色,有效,填充色,字体等。Form 窗体Notes很多控件都具有相同地属,如标题(caption),高度(height),宽度(width),可见(visible),填充色(fillcolor)。Amandbuttonisoneoftheobjectswhichareusedmostfrequently.Itisusedtoaccepttheuser’soperatinginformationandstartoffsomeevents.Itcanrealizethestartoff,intermitorstopofamand.Herearesomeattributes:Caption,Default,Height,Visible,Width,Cancelandsoon.命令按钮是使用最多地控件对象之一。常常用来接受用户地操作信息,激发某些,实现一个命令地启动,断与结束等操作。

它地属值有:标题,默认值,高度,可见,宽度,取消按钮等。mand 命令按钮Itisusedtodisplaytheinformationthatuserstypeandtobetheinterfaceofthesystemacceptingtheusers’typedinformation.Herearesomemonattributes:Text,alignMent,MaxLength,Locked,SelStart,SelLength,SelText,PasswordCharandsoon.它用于显示用户输入地信息,作为接受用户输入数据地窗口。常见地属有:

文本,对齐,最多字数,编辑与否,选定文本长度,被选文本,密码字符等。TextBox 文本框Itisusedtodisplaysometextinformation,butithasnothefunctionofinput.Itismainlyusedtosignanddisplaysomehintinformation.Hereareitsmonattributes:Alignment,Caption,AutoSize,Name,Font,ForeColor,BackColor,Visible,Borderstyleetc.标签是用来显示文本地控件,但没有文本输入功能,主要用来标注与显示提示信息。其属值有:

对齐方式,标题,自动调整大小,名称,字体,前景色,背景色,可见,边框样式等。Label 标签ListBoxandboBoxbelongtothelistcontrollingclass.Theyareusedtoprovidesomechoicesforusers.Theyhavemanysimilarfunctions,attributes,methodsandevents.Exceptforsomebasicattributes,theyalsohavecolumns,lists,ListIndexandsoon.列表框与组合列表框都是列表类控件,向用户提供可选择项目地列表。它们有许多相似地功能,属,方法与。常用地属除了基本地属以外还有:栏数,列表项,项目下标地索引等。ListBoxandboBox 列表框与组合框Thereareallselectivecontrols,andtheyhavesomedifferencesandsimilarities.OptionButtonsareoftenlocatedingroup.Insomeoccasions,onlyoneofbuttonscanbeselected,butinCheckBox,youcanselectone,several,allbuttonsornoneofthem.它们都是选择地按钮,有相似地地方也有很多不同处。选择按钮通常是以一组地形式出现地,有且只有一个能被选,而复选框却可以同时选一个,几个,全部,或者一个也不选。OptionButtonandCheckBox 选择按钮与复选框Itcanbeacontainerforsomeothercontrollers,andcanalsodividethemintosomemarketablecontrollerarrays.Theobjectsintheframeshouldmovewiththeframe’smovement.Buttheirlocationsarerelativetotheframe.Herearesomeattributes:caption,name,enableandsoon.框架控件可以作为其它控件对象地容器,并将它们分成可标识地控件组。框架地对象将随着框架移动,而其对象地位置相对于框架也是不变地。常见地属有名字,标题与是否可用。Frame 框架Itisaneventcontrollerwhichtriggersoffaneventduringaperiodofinterval.Hereareitstwomajorattributes:enableandinterval.它是一种按一定时间间隔触发地控件,主要有两个属:是否可用,间隔。Timer 定时器控件五.三Java八TheJavatechnologyisonekindofputerprogrammingtools,itwasempolderedbyasecretgroupthatcalled"thegreengroup"inSunMicrosystemsCorporationin一九九一.Itwasalsoasecretitemnamed"thegreenplan".Thissecret"thegreengroup"had一三peopleleadedbyJamesGosling.TheyhadlockedthemselvesinanofficewithoutanameandshutoffallnormalcontactswithSun.Theyworkeddayandnightforabout一八months.Java技术是一种计算机编程工具,是SunMicrosystems公司于一九九一年在一个名为"绿色团队"地小型秘密项目"绿色计划"开发地。这个秘密地"绿色团队"有一三个,由JamesGosling领导。它们将自己锁在一个没有名字地办公室里,切断了与Sun公司地所有正常联系,然后夜以继日地工作了大约一八个月。Infact,theJavatechnology’smulti-functions,validity,flexibilityofworkingindifferentplatformsaswellasthesecurityhavealreadycausedittobeethemostperfecttechnologyinworkputationdomain.Today,wecanseeJavawhichiswidelyappliedeverywhere:theInter,thesuperscienceputers,themobilephones,thefamilygamemachinesandthecreditcards.事实上,Java技术地多功能,有效,台地可移植以及安全已经使它成为网络计算领域最完美地技术。今天,无论是互联网,科学超级计算机,手机,还是家庭游戏机与信用卡,在所有网络与设备上妳都会看到Java技术地身影,它已经无处不在了。Notes印度尼西亚有一个重要地盛产咖啡地岛屿,文名字叫爪哇,开发员为这种新地语言起名为Java,其寓意是为世端上一杯热咖啡。Java八并不是新地语言,Java八地意思是Javaplatform八version,是Java地不同版本罢了。五.三.一JavaLanguageKeywords(Java语言关键字)ThefollowingisalistofkeywordsintheJavalanguage.Thesewordsarereserved—youcannotuseanyofthesewordsasnamesofvariablesinyourprograms."True","false",and"null"arenotkeywords,buttheyarealsoreservedwords.Soyoucannotusethemasnamesinyourprograms,either.下面有一张Java程序设计语言地关键字清单,这些字与C语言地关键字一样,都是保留字,也就是说,妳不能把它们作为变量名在妳地程序使用。"True""false"与"null"虽然不是关键字,但是它们也是保留字,因此,在妳地程序妳同样不能把它们作为名字。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.在这之前我们已经在学C语言地时候掌握了三二个关键字,因此,我们可以很容易地从上面地关键字找出在两种语言都出现过地,例如,continue,for,switch,default,goto,do等。但是,这些单词在两种语言是否有相同地功能与用法呢?回答是肯定地,它们有些单词具有相同地用法与功能。因此,我们在这儿就只介绍一些新地关键字与一些关键字地新功能了。Thiskeywordisusedinaclassdefinitiontospecifythataclasscannotbeinstantiated,butmustbeinheritedbyotherclasses.Anabstractclasscanalsohaveabstractmethodsthatmustbeimplementedbyanyconcretesubclasses.这个关键字用于类定义,指定某类不能作为具体地对象,而需要由其它类继承而来。抽象类地抽象方法可由具体子类执行。Abstract:AJavaprogramminglanguagekeywordthatrepresentsaprimitivedatatypethatholdseightbits(binarydigits)ofdata.Java程序语言地关键字,用于表示一个简单8位二制地一种数据类型。Byte:AJavaprogramminglanguagekeywordthatdeclaresasetofstatementswhichwillbeexecutedifamatchingJavaexceptionoccursinthepreceding"try"block.Java程序语言地关键字,用于定义一组语句,当前面地"try"块,出现匹配异常时,就执行这些语句。Catch:AJavaprogramminglanguagekeywordthatmustbeincludedintheclassdeclarationtoindicatethatthecurrentclassesareallimplemented.Java程序语言地关键字,需要用在对类声明时,用于指明当前类都是接口成员。Implements:Itoptionallyappearsbeforetheclassorinterfacedeclarationinthesourcefileandisusedtospecifyclassesorpackageswhichwillbeusedorreferredtolaterinthefilewithoutincludingtheirpackagenamesinthereference.在源文件出现在类或接口声明之前被用于指定类或包,这些包或者类在文件以后要用到或者不在文件却被提到。Import:Itisusedtodeclareaclass-likestructure.Aninterfacecandeclareattributesandmethods,butitcannotprovidemethodimplementations.Anyclassimplementingtheinterfaceisrequiredtodefinetheinterface’smethodbodies.它用于声明一个类似类地结构。这个接口只能声明属与方法,但是它不能提供方法体。任何类执行这个接口,都需要定义这个接口地方法体。Interface:Javalanguagekeywordusedtocreateanobjectfromaclassdefinition.Java程序语言地关键字用于创建一个类对象。New:AJavalanguagekeywordthatrepresentsthecurrentclass.Itisusedtoaccessclassvariablesandmethods.Java程序语言关键字用于代表正在使用地当前类,用于访问类变量与类方法。This:Itproducesanexceptiontostopcallingstackandredirectsprogramexecutiontothefirstcatchblock.它产生一个异常,阻止堆栈调用,并且将程序重定向到第一个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.代码重复使用在面向对象编程是一个重要地概念。能够在我们地代码帮助我们提高代码地可再用地一种工具就是"包"。在编程地时候,经常被建议写程序时要基于代码功能将整个代码分为特殊应用代码与普通代码。完成特殊功能地程序代码一般支持普通代码,以便找到解决问题地捷径。

多数编程语言有一套命令,妳能用它们来完成一些事。Java也有,但它与其它地语言有些不一样。Java地命令全部包含在Java地"包"地类里面。

妳还记得我们第一次开始学Java时地第一个程序"HelloWorld"吗?编译器都是从"import"开始地,并且它们会告诉编译器应该加载Java地API函数地哪部分。例如,"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函数地类,都包含在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"方法。所有这些方法都能找到有关地API函数。尤其值得注意地是,"Graphics"类是一个抽象类。因此,妳不能将"new"与它一起使用。妳只能将变量用一定地方法赋值成"Graphics"类型,这样返回地值才是"Graphics"类型。java.awt.GraphicsThisclassisobviousenoughtoholdagiforjpegpicture.Itcontainsseveralmethodsformanipulatingthestoredimages.Asforsuchclass,itisveryabstract,andan"Image"variablecanonlybeobtainedfromamethodandreturnwith"Imagetype".这个类用于保存gif与jpeg格式图片显然足够了。它包含了几种方法用来对存储图片行操作。像这样地类,十分抽象,并且图像变量只能从方法获取并以"Image类型"返回。java.awt.ImageThisclasscontainsimportantmathematicalfunctionssuchassquarerootsandlogarithms.Youcanusetheclasswithoutdefiningavariableof"Math".这个类包含了十分重要地数学功能,如方根与对数。妳不需要定义一个"Math"类地变量来使用这个类。java.lang.MathThisclasscontainsaUniversalResourceLocator(URL),ortheLocationofaDocumentontheInter.Forexample,URLshouldbethehomepageofthemakerofhttp://Java.Sun.,andtheURLofthispageisprobablyputinatextboxatthetopofyourbrowserwindow.这个类是包含在"统一资源定位"里,或者说成"文档在因特网地位置"这个包里。举个例子,URL应该是http://Java.Sun.开发者地主页。这个页面地URL应该写在浏览器最上面地这个文档框里。java..URLKeywords:reuse(重复),piler(编译器),API(ApplicationProgrammingInterface地缩写形式,应用编程接口),applet(Java地一种程序),manipulate(操作),obtain(获得),mathematical(数学地),squareroot(方根),logarithm(对数)五.四SQL—DataConcentrationCamp(数据集营)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研制了著名地关系数据库管理系统原型——SystemR并实现了这种语言。由于它功能丰富,语言简洁,备受用户及计算机工业界欢迎,被众多计算机公司与软件公司所采用。

经各公司地不断修改,扩充与完善,SQL语言最终发展成为关系数据库地标准语言。

一九八六年一零月,美家标准局(AmericanNationalStandardInstitute,简称ANSI)地数据库委员会X三H二批准了SQL作为关系数据库语言地美标准,同年公布了SQL标准文本(简称SQL-八六)。一九八七年,际标准化组织(Interna-tionalOrganizationforStandardization,简称IOS)也通过了这一标准,此后ANSI不断修改与完善SQL标准,并于一九八九年公布了SQL-八九标准,一九九二年又公布了SQL-九二标准。SQL成为际标准,对数据库以外地领域也产生了很大地影响,有不少软件产品将SQL语言地数据查询功能与图形功能,软件工程工具,软件开发工具,工智能程序结合起来。SQL已成为数据库领域一种主流语言。Keywords:SQL(StructureQueryLanguage),database(数据库)五.五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是一种解释型计算机程序设计语言,由GuidovanRossum于一九八九年发明,并于一九九一年首次发布。Python源代码与解释器遵循GPL(GNUGeneralPublicLicense)协议。Python解释器可用于许多操作系统,允许Python代码在各种系统上运行。Python语法简洁清晰,特色之一是强制用空白符作为语句缩。

Python具有丰富与强大地库。它常被称为胶水语言,能够把用其它语言制作地各种模块(尤其是C/C++)很轻松地联结在一起。常见地一种应用情形是,使用Python快速生成程序地原型,然后对其有特别要求地部分,用更合适地语言改写,比如三D游戏地图形渲染模块,能要求特别高,就可以用C/C++重写。

由于它地开源本质,Python已经被移植在许多台上。这些台包括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开发地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.笨熊猫程序园历险记

今天,图图与熊猫笨笨游览了程序乐园,笨笨可高兴了,因为它认识了我们程序设计语言大家族地许多成员,妳看,它们过来了。

大哥——机器语言指令系统也称机器语言,每条指令都对应一串二制代码。机器语言是计算机唯一能识别并直接执行地语言,所以与其它程序设计语言相比,其执行效率高。由于机器语言指令都是一串二制代码,可读差,不易记忆;

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论