外文翻譯---visual basic 語(yǔ)言與算法_第1頁(yè)
已閱讀1頁(yè),還剩16頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡(jiǎn)介

1、<p><b>  畢業(yè)論文</b></p><p><b>  外文翻譯</b></p><p>  題 目 題庫(kù)系統(tǒng)與試卷生成 </p><p>  專 業(yè) 信息管理與信息系統(tǒng) </p><p>  班 級(jí) 08信管2班 &

2、lt;/p><p>  學(xué) 生 王 睿 </p><p>  學(xué) 號(hào) 20806146 </p><p>  指導(dǎo)教師 付 促 </p><p><b>  高科學(xué)院</b></p><p&g

3、t;<b>  2012 年</b></p><p>  Visual Basic language and arithmetic</p><p>  The United States launched the Microsoft Visual Basic (may be referred to VB), is the latest version of th

4、e current VB 2008 Beta2 (VB9) Chinese version. Visual meaning the visual, visible, referring to the development of operating systems like windows graphical user interface (Graphic User Interface, GUI) method, it does not

5、 need to prepare a large number code to describe the appearance of the interface elements and location, as long as the pre - The establishment of good drag and drop objects o</p><p>  Visual Basic learning,

6、Professional Edition and Enterprise Edition versions to meet the different needs of the development. Study and apply to the ordinary version of the majority of learners and the use of Visual Basic development of the gene

7、ral staff of Windows applications, but professional version for computer professional development of staff, including the study of functional version of the full content control and Internet development tools such as adv

8、anced features ,Enterprise contain no</p><p>  Visual Basic Section 1 the summary of Visual Basic Microsoft Visual Basic, ( abbreviate VB )as tool the most of application program one of under Windows operati

9、ng platform. No matter beginner or professional developer, VB has all offered a whole set of tools to them, Development application program that it can be relaxed and convenient. So VB as most computer first-selected the

10、 ABC of programming language of beginner. " Visual" mean method to adopt visual user of development figure interface (GU</p><p>  VB is a kind of programming language in common use of Microsoft, It

11、, including VBA of the numerous Windows application software use VB language in Microsoft Excel, Microsoft Accessed.</p><p>  For users to carry on the secondary development; Make web page use more VBScript

12、script language sub collection of VB too at present. Utilize data of VB visit characteristic user can establish the data base to most data base forms including Microsoft SQL Server and other enterprises data base With th

13、e application program of front, and adjustable service end part. Utilize ActiveX(TM) technology, VB can use word processor, electronic data list he Windows function that application program offers ex</p><p>

14、  The procedure that users established finally is a real .EXE file,can issue freely.VB offer study edition, the specialty edition and enterprise edition, use to satisfied with different development demands. Study edition

15、 make programming personnel develop Windows and Windows application program of NT very easily.The specialty edition has offered the developing instrument with complete function to programming personnel of the specialty.I

16、nclude studying all functions of edition in the specialty edit</p><p>  In VB, the application program calls the project too. When start VB and open a new project for the first time, can see and pursue integ

17、rated development environment interface that show. Visual Basic Integrated development environment VB come and organize development of application program through project, use project come and manage and form files of ap

18、plication program. One project uses the environment to make up by several window bodies, standard module generally. </p><p>  The system manages project through the project menu, for instance add the window

19、body, quote . System allow turn on and manage a lot of projects besides. Section 3 Visual Basic language brief introductions Basic use and do the elementary high-level language that used often most. Its full name is Begi

20、nner' s All-purpose Symbolic Instruction Code, abbreviate as BASIC. </p><p>  As its name suggests, Basic one specially for language that beginner design, because it easy to learn easy to know, So the bo

21、dy is popular. Early Basic language to belong to and solve translating type, so can carry out line by line , So it can see the result carried out at once , this is a very convenient design for beginner. But it have conce

22、pt of structure either, one that is in procedure maintain and management have as much as other language problems. But back-end Basic correct shortcoming of</p><p>  “Editing machine of code” window Section 4

23、 develop the application program with Visual Basic Use VB programming, design appearance of application program first generally, write every target procedure code or other treatment procedure of incident respectively, Wo

24、rk of programming should be light more. </p><p>  The procedure of establishing the application program is as follows: </p><p>  1.Establish application program interface The interface is the mu

25、tual bridge of user and procedure, Generally formed of window body and vision frame of the button, menu, text frameset. with standard WINDOWS interface of application program that VB establish. Require according to funct

26、ion of procedure and user and need of information interchange of procedure, Come to confirm that need those targets,plan the overall arrangement of the interface. </p><p>  2. Design by each attributes of ta

27、rget in interface Demand and set up each attribute of target such as appearance, name, size of targeted. According to interface of planning. Most attribute person who fetch can set up through the attribute window when de

28、sign already. Too can set up revising when operating in procedure through programming in procedure code. Have the targets respond programming by procedure code. </p><p>  3. Respond procedure code of program

29、ming target Interface determine appearance of procedure only, design window add codes through" code editing machine" soon after the interface, Realize some make the tasks, such as responding, information proces

30、sing, etc. after accepting external message, Add code , realize some response, information processing that make after accepting external information task, As editor's window of code pursued shows add codes “code edit

31、ing machine” window </p><p>  4. Keep project One VB procedure one project, at the time of designing a application program, system will set up one be expanded and called. Project file of vbp, project file in

32、clude all relevant information of file that project set up this, Keep project keep associated documents of project this at the same time. For example the window body produced when design interfaces is kept and being expa

33、nded and being called. From sum. In the window body of foxfire. At the time of opening a project( file)</p><p>  5. Operate and debugged by procedure Operate the procedure thoroughpin operate" selecting

34、 in the menu, when the mistake appears, VB system can offer information prompt can looked for and get rid of the mistake thoroughpin debug" within operate" menus too. </p><p>  6. Can produce by ex

35、ecutive program For make procedure can break away from VB environment, order to become next life through" file"" producing project 1.exe" of menu but executive program (eyeful).</p><p>  

36、Can carry out this file directly after this. In produce, + executive program, and then through install guide bale all associated documents.Can run independently after installation under the environment of windows 9 x/200

37、0 as a software product. </p><p>  In computer system's any software, is by the every large or small each kind of software constituent constitution, defers to the specific algorithm to realize respective

38、ly, the algorithm quality direct decision realizes the software performance fit and unfit quality. </p><p>  Designs the algorithm with any method, what resources designs the algorithm to need, requires how

39、many running time, how many storage space, how to determine an algorithm the quality, when realizes a software, is must give to solve. In computer system's operating system, the language compiling system, the databas

40、e management system as well as in various computer application system's software, must use each one concrete algorithm to realize. </p><p>  Therefore, the algorithm design and the analysis are the compu

41、ter science and a technical core question. The algorithm is the problem-solving step, we may define the algorithm Cheng Jie a determination class question the random one special method. In the computer science, the algor

42、ithm needs to use the computer algorithmic language to describe, the algorithm represents with the computer solves a kind of question precisely, the effective method. </p><p>  The algorithm construction of

43、=data procedure, solves one to assign may calculate or the solvable question, the different person may compile the different procedure, solves the identical problem, here has two problems: First, with computational metho

44、d close related algorithm question; Second, programming technical question. Between the algorithm and the procedure has the close relationship. The algorithm is a group has the poor rule, they had stipulated solves some

45、specific type question a serie</p><p>  To algorithm study including five aspect contents:① Design algorithm. The algorithm design work is impossible completely the automation, should study the understanding

46、 already by the practice to prove that was the useful some basic algorithm design method, these basic design method was not only suitable for the computer science, moreover was suitable for domains and so on electrical e

47、ngineering, operations research;② Expresses the algorithm. The description algorithm's method has many kinds of f</p><p>  But the algorithm has certain characteristic, it includes:① Determinism. Algorit

48、hm each kind of operation must have the determination significance, this kind of operation should carry out what kind of movement should not to have the ambiguity, the goal is clear;② Effectiveness. Requests the operatio

49、n which in the algorithm waits for realizing is basic, each kind of operation can at least completes in the principle by the human with the paper and the pen in the limited time;③ Input. An algorithm </p><p>

50、;  The algorithm complexity is the algorithm efficiency measure, when appraises the algorithm performance, the complexity is an important basis. The algorithm complex degree with moves computer resources how many which t

51、his algorithm needs related, needs the resources are more, indicated that this algorithm the complexity is higher; Needs the resources are less, indicated that this algorithm the complexity is lower.</p><p>

52、  The spatial resources, which computer’s resources, operate most importantly, needs the time which and the stored routine and the data need, the algorithm complexity has division time complexity and the spatial complexi

53、ty. The algorithm carries out the operation on the computer, needs the data which certain storage space depositing description algorithm the procedure and the algorithm need, the computer completes the operation task to

54、require certain time.</p><p>  The procedure which writes according to the different algorithm places when on the computer operates, needs the time and the space are different, the algorithm complexity is ne

55、eds the time and the spatial one kind of measure to the algorithm operation. The different computer its operating speed difference is very big, is weighing an algorithm the complexity to note this point. Regarding questi

56、on, which assigns willfully, a profitable target which designs,the complex low algorithm is as far as po</p><p>  Therefore, the algorithm complex analysis or selects to the algorithm design has the importan

57、t guiding sense and the use value. When discussion algorithm complexity, two questions need to clarify: (1) An algorithm's complexity expresses with what kind of quantity; (2) How to calculate one to assign the algor

58、ithm the complexity. After finding solves a question the algorithm, is this algorithm realization, as for whether could find the method which realized, was decided in the algorithm circularit</p><p>  Visual

59、 Basic 語(yǔ)言與算法</p><p>  1991 年,美國(guó)微軟公司推出了 Visual Basic(可簡(jiǎn)稱 VB),目前的最新版本 是 VB 2008 Beta2(VB9)中文版。Visual 意即可視的、可見(jiàn)的,指的是開(kāi)發(fā)像 windows 操作系統(tǒng)的圖形用戶 界面(Graphic User Interface,GUI)的方法,它不需要編寫大量代碼去描述界 面元素的外觀和位置,只要把預(yù)先建立好的對(duì)象拖放到

60、屏幕上相應(yīng)的位置即可。 Basic 實(shí)際上是一個(gè)短語(yǔ)的縮寫,這個(gè)短語(yǔ)就是Beginners all_purpose symbolic instruction code,其中文意思為“初始者通用符號(hào)指令代碼語(yǔ)言”。</p><p>  Visual Basic 有學(xué)習(xí)版、專業(yè)版和企業(yè)版三種版本,以滿足不同的開(kāi)發(fā)需要。學(xué)習(xí)版適用于普通學(xué)習(xí)者及大多數(shù)使用Visual Basic開(kāi)發(fā)一般 Windows 應(yīng)用程序的人員,

61、但是;專業(yè)版適用于計(jì)算機(jī)專業(yè)開(kāi)發(fā)人員,包括了學(xué)習(xí)版的全部?jī)?nèi)容功能以及Internet控件開(kāi)發(fā)工具之類的高級(jí)特性;企業(yè)版除包含專業(yè)版全部的內(nèi)容外,還有自動(dòng)化構(gòu)件管理器等工具,使得專業(yè)編程人員能夠開(kāi)發(fā)功能強(qiáng)大的組骨子里分布式應(yīng)用程序。Visual Basic第 1節(jié) Visual Basic 的概述 Microsoft Visual Basic(簡(jiǎn)稱 VB)是在 Windows 操作平臺(tái)下設(shè)計(jì)應(yīng)用程序的最速度、最簡(jiǎn)捷的工具之一。不論是初學(xué)者

62、還是專業(yè)開(kāi)發(fā)人員,VB 都為他們提供了一整套的工具,可以輕松方便的開(kāi)發(fā)應(yīng)用程序。因此,VB一直被作為大多數(shù)電腦初學(xué)者的首選入門編程語(yǔ)言。 “Visual”指的是采用可視化的開(kāi)發(fā)圖形用戶界面(GUI)的方法,一般不需要編寫大量代碼去描述界面元素的外觀和位置,而只要把需要的控件拖放到屏 幕上的相應(yīng)位置即可方便圖形設(shè)計(jì)圖形用戶界面; “Basic”指的是BASIC語(yǔ)言,因?yàn)?VB </p><p>  VB是 Micr

63、osoft的一種通用程序設(shè)計(jì)語(yǔ)言,它包括在 Microsoft Excel、 Microsoft Access 等眾多 Windows 應(yīng)用軟件中的 VBA 都使用 VB 語(yǔ)言,以供用戶進(jìn)行二次開(kāi)發(fā);目前制作網(wǎng)頁(yè)使用較多的 VBScript 腳本語(yǔ)言也是 VB 的子集。</p><p>  利用 VB 的數(shù)據(jù)訪問(wèn)特性用戶可以對(duì)包括 Microsoft SQL Server 和其他企 業(yè)數(shù)據(jù)庫(kù)在內(nèi)的大部分?jǐn)?shù)據(jù)庫(kù)格式

64、創(chuàng)建數(shù)據(jù)庫(kù)和前端應(yīng)用程序,以及可調(diào)整的服 務(wù)端部件。利用 ActiveX(TM)技術(shù),VB 可使用 Microsoft Word 字處理器、Microsoft Excel 電子數(shù)據(jù)表極其他 Windows 應(yīng)用程序提供的功能,甚至可直接 使用由 VB 專業(yè)版或企業(yè)版創(chuàng)建的應(yīng)用程序和對(duì)象。</p><p>  用戶最終創(chuàng)建的程序是一個(gè)真正的.EXE 文件,可以自由發(fā)布。 VB 提供了學(xué)習(xí)版,專業(yè)版和企業(yè)版,用以滿足

65、不同的開(kāi)發(fā)需求。學(xué)習(xí)版使 編程人員很容易地開(kāi)發(fā) Windows 和 Windows NT 的應(yīng)用程序。專業(yè)版為專業(yè)編程人員提供了功能完備的開(kāi)發(fā)工具,專業(yè)版中包含了學(xué)習(xí)版的所有功能。企業(yè)版允許專業(yè)人員以小組的形式來(lái)創(chuàng)建強(qiáng)大的分布式應(yīng)用程序。它包括專業(yè)版的所有的 特性。所以可以根據(jù)不同的需要來(lái)選擇不同的版本。第 2 節(jié)集成開(kāi)發(fā)環(huán)境 VB 的集成環(huán)境或稱 IDE,由多個(gè)部分組成,包含了標(biāo)題欄、 菜單欄、工具欄、控件箱,以及窗體設(shè)計(jì)器窗口、工程

66、管理器窗口、屬性窗口、代碼窗口和窗體布 局窗體布局等。覆蓋了開(kāi)發(fā)應(yīng)用程序的設(shè)計(jì)、編輯、編譯和調(diào)試等所有功能。</p><p>  在 VB 中,應(yīng)用程序也稱工程。當(dāng)?shù)谝淮螁?dòng) VB 并打開(kāi)一個(gè)新工程時(shí),可以 看到如圖所示的集成開(kāi)發(fā)環(huán)境界面。Visual Basic集成開(kāi)發(fā)環(huán)境VB通過(guò)工程來(lái)組織應(yīng)用程序的開(kāi)發(fā),使用工程來(lái)管理構(gòu)成應(yīng)用程序的所有 文件。一個(gè)工程一般由若干個(gè)窗體、標(biāo)準(zhǔn)模塊以及應(yīng)用環(huán)境組成。系統(tǒng)通過(guò)工程

67、菜單來(lái)對(duì)工程進(jìn)行管理,如添加窗體、引用等。系統(tǒng)允許同時(shí)打開(kāi)和管理多個(gè)工程。第3節(jié) Visual Basic語(yǔ)言簡(jiǎn)介Basic是最常被用來(lái)做入門使用的高級(jí)語(yǔ)言。它的全名是 Beginner’s All-purpose Sumbolic Instruction Code,簡(jiǎn)稱為 BASIC。顧名思義,Basic就是一種專為初學(xué)者設(shè)計(jì)的語(yǔ)言,因其易學(xué)易懂,所以身受歡迎。早期的Basic語(yǔ)言都是屬于解譯式的,因此可以一行一行地執(zhí)行,所以它可以立

68、刻看到執(zhí)行的結(jié)果,對(duì)初學(xué)者來(lái)說(shuō)這是很方便的設(shè)計(jì)。不過(guò)它也因此沒(méi)有結(jié)構(gòu)化的概念,在程 序的維護(hù)及管理上比起其他語(yǔ)言困難許多。不過(guò)在后期的 Basic則改正了以上的缺點(diǎn)(如 Quick Basic),使得它也可以用來(lái)開(kāi)發(fā)較大型的程序。語(yǔ)言是構(gòu)成 VB 程序的基本成分。</p><p>  VB 規(guī)定了語(yǔ)句格式和功能。語(yǔ)法:語(yǔ)句定義符[語(yǔ)句體]語(yǔ)句定義符用于規(guī)定語(yǔ)句的功能,語(yǔ)句體指定語(yǔ)句的具體內(nèi)容或要執(zhí)行的具 體操作。

69、所有語(yǔ)句的集合就是 VB 語(yǔ)言,用 VB 語(yǔ)句進(jìn)行有機(jī)組合完成某個(gè)特定功 能就是程序。界面+程序就能解決某個(gè)應(yīng)用問(wèn)題。 VB 應(yīng)用程序代碼一般在“代碼編輯器”窗口編寫。 “代碼編輯器”像是一個(gè)高度專門化的字處理軟件,有很多便于編寫 VB 代碼的功能,圖所示為[例 Ex-Hello]在“代碼編輯器”窗口編寫的代碼。</p><p>  “代碼編輯器”窗口第4節(jié)用Visual Basic開(kāi)發(fā)應(yīng)用程序使用 VB 編程,

70、一般先設(shè)計(jì)應(yīng)用程序的外觀,然后再分別編寫各對(duì)象事件的 程序代碼或其他處理程序,編程的工作要輕松多。創(chuàng)建應(yīng)用程序的步驟如下:</p><p>  1.創(chuàng)建應(yīng)用程序界面。界面是用戶和程序交互的橋梁,用 VB 創(chuàng)建的標(biāo)準(zhǔn)的 WINDOWS 應(yīng)用程序的界面一般由窗體和按鈕、菜單、文本框的圖象框等構(gòu)成。根據(jù)程序的功能要求和用戶與程序之間的信息交流的需要,來(lái)確定需要那些對(duì)象,規(guī)劃界面的布局。</p><p

71、>  2.設(shè)計(jì)界面上各個(gè)對(duì)象的屬性 根據(jù)規(guī)劃的界面要求設(shè)置各個(gè)對(duì)象的屬性,比如對(duì)象的外貌、名稱、顏色、大小等。大多數(shù)屬性取值既可以在設(shè)計(jì)時(shí)通過(guò)屬性窗口來(lái)設(shè)置, 也可以在程序代碼中通過(guò)編程在程序運(yùn)行時(shí)設(shè)置修改。</p><p>  3.編程對(duì)象響應(yīng)的程序代碼界面僅僅決定了程序的外觀,設(shè)計(jì)完界面后就要通過(guò)“代碼編輯器”窗口來(lái)添加代碼,實(shí)現(xiàn)一些在接受外界信息后作出響應(yīng)、信息處理等任務(wù),添加代碼,實(shí)現(xiàn)一些在接受外界

72、信息后作出的響應(yīng)、信息處理等任務(wù),添加代碼如圖的代碼編輯窗口所示 “代碼編輯器”窗口 </p><p>  4.保存工程 一個(gè) VB 程序就是一個(gè)工程,在設(shè)計(jì)一個(gè)應(yīng)用程序時(shí),系統(tǒng)會(huì)建立一個(gè)擴(kuò)展名為.vbp 的工程文件,工程文件包含了該工程所建立的所有文件的相關(guān)信息,保存工程就同時(shí)保存了該工程的所有相關(guān)文件。比如當(dāng)設(shè)計(jì)界面時(shí)產(chǎn)生的窗體保 存在擴(kuò)展名為.frm 和.frx 的窗體文件中。在打開(kāi)一個(gè)工程(文件)時(shí),該工

73、程 有關(guān)的所有文件同時(shí)被裝載。</p><p>  5.行和調(diào)試程序通過(guò)“運(yùn)行”菜單中的選項(xiàng)來(lái)運(yùn)行程序,當(dāng)出現(xiàn)錯(cuò)誤時(shí), VB系統(tǒng)可以提供信息提示也可通過(guò)“調(diào)試”和“運(yùn)行”菜單來(lái)查找和排除錯(cuò)誤。</p><p>  6.生成可執(zhí)行程序?yàn)榱耸钩绦蚩梢悦撾x VB 環(huán)境,通過(guò)“文件”菜單中的“生成工程 1.exe” 命令來(lái)生成可執(zhí)行程序(.exe 文件),此后即可直接執(zhí)行該文件。在生成可+執(zhí)行程序

74、后,再通過(guò)安裝向?qū)⑺邢嚓P(guān)文件打包,就可以作為一個(gè)軟件產(chǎn)品在 windows 9x/2000 環(huán)境下安裝后獨(dú)立運(yùn)行。</p><p>  VB 的數(shù)據(jù)庫(kù)編程方面按其難易程度可分為三類(由易到難);1.使用數(shù)據(jù)庫(kù)控制項(xiàng)和綁定控制項(xiàng)。2.使用數(shù)據(jù)庫(kù)對(duì)象變量進(jìn)行編程。 3.直接調(diào)用 ODBC2.0API 。</p><p>  在使用 VB 進(jìn)行數(shù)據(jù)庫(kù)編程時(shí),通常,會(huì)首先選擇三種基本方法之一來(lái)

75、進(jìn)行數(shù)據(jù)庫(kù)應(yīng)用程序的方案設(shè)計(jì), 現(xiàn)在就將以上三種設(shè)計(jì)方法的適應(yīng)范圍及其優(yōu)缺點(diǎn)進(jìn)行一個(gè)比較。</p><p>  1.使用數(shù)據(jù)庫(kù)控制項(xiàng)和綁定控制項(xiàng) </p><p>  1.1 優(yōu)點(diǎn):它是三種方法中編碼量最小的不必了解 CDBC2.0API 的細(xì)節(jié)允許使用標(biāo)準(zhǔn)的和第三方廠商制訂的控制項(xiàng)簡(jiǎn)化了錯(cuò)誤處理,支持所有的動(dòng)態(tài)集方法及屬性</p><p>  1.2 缺點(diǎn):不能存

76、取快照對(duì)象(snapshop)對(duì)象或表格對(duì)象(都屬于記錄集對(duì)象)不能存取數(shù)據(jù)庫(kù)集合,比如表定義 (TableDefs)字段(Fieds),索引( Indexes)及查詢定義(QueryDefs) 只能存取部分 ODBC2.0 管理函數(shù)不能進(jìn)行真正的事務(wù)處理有限的錯(cuò)誤診斷功能 </p><p>  1.3 應(yīng)用:對(duì)中小規(guī)模的數(shù)據(jù)庫(kù)表(通常少于一千條記錄)只進(jìn)行簡(jiǎn)章的瀏覽操作基本 SQL 查詢所對(duì)應(yīng)的結(jié)果集長(zhǎng)度有限(

77、通常結(jié)果集的記錄數(shù)小于一百,這些記錄從一個(gè)或兩個(gè)長(zhǎng)度有限的表中檢索出來(lái))應(yīng)用程序的數(shù)據(jù)輸入/輸出項(xiàng)較少。通常只涉及一個(gè)或兩個(gè)長(zhǎng)度有限的表、并且表中的字段數(shù)在10個(gè)左右且不具有關(guān)系完整性限制 </p><p>  2.使用數(shù)據(jù)庫(kù)對(duì)象變量進(jìn)行編程 </p><p>  2.1優(yōu)點(diǎn):可以在程序中存取 ODBC2.0 的管理函數(shù) 可以控制多種記錄集類型:Dynaset、Snapshop 及 Ta

78、ble 記錄集合對(duì)象 可以存取存儲(chǔ)過(guò)程和查詢動(dòng)作可以存取數(shù)據(jù)庫(kù)集合對(duì)象,例如 TableDefs、Fields、Indexes及QueryDefs具有真正的事務(wù)處理能力,包括啟動(dòng)事務(wù) ( Begintrans)、提交事務(wù)(CommitTrans)及回滾事務(wù)(Rollback)</p><p>  2.2 缺點(diǎn):比使用數(shù)據(jù)控制項(xiàng)的方法編碼量較大 只能進(jìn)行間接的錯(cuò)誤處理和錯(cuò)誤恢復(fù) 對(duì)每個(gè)數(shù)據(jù)庫(kù)操作沒(méi)有細(xì)粒度的控制 對(duì)

79、結(jié)果集和包含結(jié)果集的內(nèi)豐資源的操作受到限制 同直接使用 ODBC2.0API 函數(shù)的方法相比性能較低</p><p>  2.3 應(yīng)用:應(yīng)用程序需要在執(zhí)行期間動(dòng)態(tài)地建立表、字段及索引. 應(yīng)用程序涉及同步更新幾張表(但在邏輯上保持一致性)的復(fù)雜事務(wù)應(yīng)用程序使用結(jié)果集而不是Dynaset的窗體(FORMS),例如 Snapshots或 Tables,這里是設(shè)計(jì)要考慮的關(guān)鍵 應(yīng)用程序的表非常大,多于 1000 條記錄

80、應(yīng)用程序具有復(fù)雜的數(shù)據(jù)輸入/輸出項(xiàng),它涉及許多內(nèi)部相關(guān)的字段并且包括數(shù)據(jù)庫(kù)參照完整性或一致性規(guī)則 應(yīng)用程序需要執(zhí)行一些額外的操作和對(duì)結(jié)果集的查詢后處理, 尤其是需要 很高的數(shù)據(jù)格式化顯示 應(yīng)用程序需要利用復(fù)雜的 ODBC 管理功能以選擇、配置、校驗(yàn)及建立各種數(shù) 據(jù)源 應(yīng)用程序需要在執(zhí)行期間“顯示”數(shù)據(jù)庫(kù)的基本結(jié)構(gòu) 應(yīng)用程序需要使用復(fù)雜的多碼索引方式來(lái)檢索或更新記錄。</p><p>  3.直接調(diào)用 ODBC2.

81、0API </p><p>  3.1 優(yōu)點(diǎn):可以直接參與結(jié)果集的開(kāi)發(fā)、管理及規(guī)范化 對(duì)結(jié)果集游標(biāo)提供了更多的控制,并且提供了更多的游標(biāo)類型和執(zhí)行動(dòng)作 能夠確定 ODBC 驅(qū)動(dòng)程序及 SQL 的一致性級(jí)別可以更好地控制Windows的執(zhí)行調(diào)度及資源利用其他方面同其他方法差不多,因此這種方法很可能具有最好的性能。</p><p>  3.2 缺點(diǎn):較其他兩種方法需要大量的代碼,代碼復(fù)雜并且

82、要求程序員具有編制 API 調(diào)用的經(jīng)驗(yàn)在網(wǎng)絡(luò)上 Visual Basic 運(yùn)行期間庫(kù)的錯(cuò)誤處理缺乏安全性,因此代碼運(yùn)行期 間出現(xiàn)的錯(cuò)誤所造成的后果會(huì)非常嚴(yán)重 </p><p>  3.3 應(yīng)用:如果系統(tǒng)環(huán)境為客戶機(jī)/服務(wù)器模式下的大規(guī)模多用戶環(huán)境,那么應(yīng)用程序 必須都能夠準(zhǔn)確地解決可能出現(xiàn)的系統(tǒng)錯(cuò)誤和失敗應(yīng)用程序強(qiáng)調(diào)資源使用,這里如何對(duì)內(nèi)存、網(wǎng)絡(luò)服務(wù)器資源進(jìn)行直接控制是首要的考慮因素應(yīng)用程序使用超大規(guī)模數(shù)據(jù)庫(kù),例

83、如數(shù)據(jù)庫(kù)表可能包含幾萬(wàn)或幾十萬(wàn)條記錄計(jì)算機(jī)系統(tǒng)中的任何軟件,都是由大大小小的各種軟件組成部分構(gòu)成,各自按照特定的算法來(lái)實(shí)現(xiàn),算法的好壞直接決定所實(shí)現(xiàn)軟件性能的優(yōu)劣。</p><p>  用什么方法來(lái)設(shè)計(jì)算法.所設(shè)計(jì)算法需要什么樣的資源,需要多少運(yùn)行時(shí)間、多少存儲(chǔ)空間,如何判定一個(gè)算法的好壞,在實(shí)現(xiàn)一個(gè)軟件時(shí),都是必須予以解決的。計(jì)算機(jī)系統(tǒng)中的操作系統(tǒng)、語(yǔ)言編譯系統(tǒng)、數(shù)據(jù)庫(kù)管理系統(tǒng)以及各種各樣的計(jì)算機(jī)應(yīng)用系統(tǒng)中的軟

84、件,都必須用一個(gè)個(gè)具體的算法來(lái)實(shí)現(xiàn)。</p><p>  因此,算法設(shè)計(jì)與分析是計(jì)算機(jī)科學(xué)與技術(shù)的一個(gè)核心問(wèn)題。算法是解題的步驟, 我們可以把算法定義成解一確定類問(wèn)題的任意一種特殊的方法。在計(jì)算機(jī)科學(xué)中,算法要用計(jì)算機(jī)算法語(yǔ)言描述,算法代表用計(jì)算機(jī)解 一類問(wèn)題的精確、有效的方法。</p><p>  算法+數(shù)據(jù)結(jié)構(gòu)=程序,求解一個(gè)給定的可計(jì)算或可解的問(wèn)題,不同的人可以編寫出不同的程序,來(lái)解

85、決同一個(gè)問(wèn)題,這里存在兩個(gè)問(wèn)題:一是與計(jì)算方法密切相關(guān)的算法問(wèn)題;二是程序設(shè)計(jì)的技術(shù)問(wèn)題。算法和程序之間存在密切的關(guān)系。算法是一組有窮的規(guī)則,它們規(guī)定了解決某一特定類型問(wèn)題的一系列運(yùn)算,是對(duì)解題方案的準(zhǔn)確與完整的描述。制定一個(gè)算法,一般要經(jīng)過(guò)設(shè)計(jì)、確認(rèn)、分析、編碼、測(cè)試、調(diào)試、計(jì)時(shí)等階段。</p><p>  對(duì)算法的學(xué)習(xí)包括五個(gè)方面的內(nèi)容:① 設(shè)計(jì)算法。算法設(shè)計(jì)工作是不可能完全自動(dòng)化的,應(yīng)學(xué)習(xí)了解已經(jīng)被實(shí)踐證明

86、是有用的一些基本的算法設(shè)計(jì)方法,這些基本的設(shè)計(jì)方法不僅適用于計(jì)算機(jī)科學(xué),而且適用于電氣工程、運(yùn)籌學(xué)等領(lǐng)域;② 表示算法。描述算法的方法有多種形式,例如自然語(yǔ)言和算法語(yǔ)言,各自有適用的環(huán)境和特點(diǎn);③確認(rèn)算法。算法確認(rèn)的目的是使人們確信這一算法能夠正確無(wú)誤地工作,即該算法具有可計(jì)算性。正確的算法用計(jì)算機(jī)算法語(yǔ)言描述,構(gòu)成計(jì)算機(jī)程序, 計(jì)算機(jī)程序在計(jì)算機(jī)上運(yùn)行,得到算法運(yùn)算的結(jié)果;④分析算法。算法分析是 對(duì)一個(gè)算法需要多少計(jì)算時(shí)間和存儲(chǔ)空間作

87、定量的分析。分析算法可以預(yù)測(cè)這一算法適合在什么樣的環(huán)境中有效地運(yùn)行,對(duì)解決同一問(wèn)題的不同算法的有效性做出比較;⑤驗(yàn)證算法。用計(jì)算機(jī)語(yǔ)言描述的算法是否可計(jì)算、有效合理,須對(duì)程序進(jìn)行測(cè)試,測(cè)試程序的工作由調(diào)試和作時(shí)空分布圖組成。 </p><p>  而算法具有一定的特性,它包括:①確定性。算法的每一種運(yùn)算必須有確 定的意義,該種運(yùn)算應(yīng)執(zhí)行何種動(dòng)作應(yīng)無(wú)二義性,目的明確;② 能行性。要求算法中有待實(shí)現(xiàn)的運(yùn)算都是基本的,

88、每種運(yùn)算至少在原理上能由人用紙和筆在有限的時(shí)間內(nèi)完成;③輸入。一個(gè)算法有0個(gè)或多個(gè)輸入,在算法運(yùn)算開(kāi)始之前 給出算法所需數(shù)據(jù)的初值,這些輸入取自特定的對(duì)象集合;④輸出。作為算法運(yùn)算的結(jié)果,一個(gè)算法產(chǎn)生一個(gè)或多個(gè)輸出,輸出是同輸入有某種特定關(guān)系的量;⑤有窮性。一個(gè)算法總是在執(zhí)行了有窮步的運(yùn)算后終止,即該算法是可達(dá)的。滿足前四個(gè)特性的一組規(guī)則不能稱為算法,只能稱為計(jì)算過(guò)程,操作系統(tǒng)是計(jì)算過(guò)程的一個(gè)例子,操作系統(tǒng)用來(lái)管理計(jì)算機(jī)資源,控制作業(yè)的

89、運(yùn)行,沒(méi)有作業(yè)運(yùn)行時(shí),計(jì)算過(guò)程并不停止,而是處于等待狀態(tài)。</p><p>  算法的復(fù)雜性是算法效率的度量,在評(píng)價(jià)算法性能時(shí),復(fù)雜性是一個(gè)重要的依據(jù)。算法的復(fù)雜性的程度與運(yùn)行該算法所需要的計(jì)算機(jī)資源的多少有關(guān),所需要的資源越多,表明該算法的復(fù)雜性越高;所需要的資源越少,表明該算法的復(fù)雜性越低。</p><p>  計(jì)算機(jī)的資源,最重要的是運(yùn)算所需的時(shí)間和存儲(chǔ)程序和數(shù)據(jù)所需的空間資源,算法

90、的復(fù)雜性有時(shí)間復(fù)雜性和空間復(fù)雜性之分。算法在計(jì)算機(jī)上執(zhí)行運(yùn)算,需要一定的存儲(chǔ)空間存放描述算法的程序和算法 所需的數(shù)據(jù),計(jì)算機(jī)完成運(yùn)算任務(wù)需要一定的時(shí)間。根據(jù)不同的算法寫出的程序放在計(jì)算機(jī)上運(yùn)算時(shí),所需要的時(shí)間和空間是不同的,算法的復(fù)雜性是對(duì)算法運(yùn)算所需時(shí)間和空間的一種度量。不同的計(jì)算機(jī)其運(yùn)算速度相差很大,在衡量一個(gè)算法的復(fù)雜性要注意到這一點(diǎn)。對(duì)于任意給定的問(wèn)題,設(shè)計(jì)出復(fù)雜性盡可能低的算法是在設(shè)計(jì)算法時(shí)考慮的一個(gè)重要目標(biāo)。</p&g

溫馨提示

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

評(píng)論

0/150

提交評(píng)論