Home Random Page


CATEGORIES:

BiologyChemistryConstructionCultureEcologyEconomyElectronicsFinanceGeographyHistoryInformaticsLawMathematicsMechanicsMedicineOtherPedagogyPhilosophyPhysicsPolicyPsychologySociologySportTourism






Unit 8. computer programming

 

Text A

 

Pre-reading task. Match the meaning of the following English words with their Russian definitions.

1. assumption a) ïðîãðàììà - îòëàä÷èê

2. event driven b) ñåòêà, òàáëèöà

3. grid c) ïðåäïîëîæåíèå, äîïóùåíèå

4. paradigm d) óïðàâëÿåìîå ñîáûòèå

5. debugger e) ñèñòåìà ïîíÿòèé, ìîäåëü

6. flowchart f) ïîñòàíîâêà çàäà÷è

7. problem statement g) ãðàôè÷åñêàÿ ñõåìà ïðîãðàììû

 

Reading. Read the text and try to guess the meaning of the words in bold. Check your variants in the dictionary.

 

PROGRAM PLANNING

 

The programming process begins with a problem statement that helps you clearly define the purpose of a computer program. In the context of programming, a problem statement defines certain elements that must be manipulated to achieve a result or goal. A good problem statement for a computer program has three characteristics:

1. It specifies any assumptions that define the scope of the problem.

2. It clearly specifies the known information.

3. It specifies when the problem has been solved.

In a problem statement an assumption is something you accept as true in order to proceed with program planning. The “known information” is the information that you supply to the computer to help it solve a problem. There are also variables (values that can change) and constants (factors that remain the same) in computer programs.

Formulating a problem statement provides a minimal amount of planning, which is sufficient for only the simplest programs. A typical commercial application requires far more extensive planning, which includes detailed program outlines, job assignments, and schedules. To some extent, program planning depends on the language and paradigm used to code a computer program. The phrase programming paradigm refers to a way of conceptualizing and structuring the tasks a computer performs. For example, whereas one programmer might focus on the steps required to complete a specific computation, another one might focus on the data that forms the basis for the computation. Quite a number of programming paradigms exist, and a programmer might use techniques from multiple paradigms while planning and coding a program.

There are different program planning tools, such as flowcharts, structured English, pseudocode, UML diagrams, and decision tables, which are used to provide sufficient planning.

Regardless of the tools used, when planning is complete, programmers can begin coding, testing, and documenting. The process of coding a computer program depends on programming language you use, the programming tools you select, and the programming paradigm that best fits the problem you are trying to solve. Programmers typically use a text editor, a program editor, or a VDE to code computer programs.

A text editor is any word processor that can be used for basic editing tasks, such as writing e-mail, creating documents, or coding computer programs. When using a text editor to code a computer program, you simply type in each instruction.



A program editor is a type of text editor specially designed for entering code for computer programs.

A VDE (visual development environment) provides programmers with tools to build substantial sections of a program by pointing and clicking rather than typing lines of code. A typical VDE is based on a form design grid that a programmer manipulates to design the user interface for a program. By using various tools provided by the VDE, a programmer can add objects, such as controls and graphics, to the form design grid. In the context of a VDE, a control is a screen-based object whose behavior can be defined by a programmer.

In visual development environment, each control comes with predefined set of events. Within the context of programming, an event is defined as an action, such as click, drag, or key press, associated with the form or control. A programmer can select the events that apply to each control. An event usually requires the computer to make some response. Programmers write event-handling code for the procedures that specify how the computer responds to each event.

A programmer’s choice of development tools depends on what is available for a particular programming language and the nature of the programming project. Text editors and program editors provide a fine tool set for programs with minimal user interfaces. A visual development environment is a powerful tool for programming software applications for GUI environments, such as Windows. Most GUI applications are “event-driven”, which means that when launched, the program’s interface appears on the screen and waits for the user to initiate an event.

A computer program must be tested to ensure that it works correctly. Testing often consists of running the program and entering test data to see whether the program produces correct results.

When a program doesn’t work correctly, it is usually the result of an error made by the programmer. A syntax error occurs when an instruction doesn’t follow the syntax rules, or grammar of the programming language. Syntax errors are easy to make, but they are usually also easy to detect and correct.

Another type of program bug is a runtime error, which, as its name indicates, shows up when you run a program. Some runtime errors result from instructions that the computer can’t execute.

Some runtime errors are classified as logic errors. A logic error is an error in the logic or design of a program. It can be caused by an inadequate definition of the problem or an incorrect formula for a calculation, and they are usually more difficult to identify than syntax errors.

Programmers can locate errors in a program by reading through lines of code, much like a proofreader. They can also use a tool called debugger to step through a program and monitor the status of variables, input, and output. A debugger is sometimes packaged with a programming language or can be obtained as an add-on.

Anyone who uses computers is familiar with program documentation in the form of user manuals and help files. Programmers also insert documentation called remarks or “comments” into the programming code. Remarks are identified by language-specific symbols.

A well-documented program contains initial remarks that explain its purpose and additional remarks in any sections of a program where the purpose of the code is not immediately clear.

 

Comprehension ñheck. Mark the following statements as True or False.

1. The programming process begins with coding.

2. A typical commercial application requires a minimal amount of planning.

3. A programmer might use techniques from multiple paradigms while planning and coding.

4. Programmers typically use a program editor to code computer programs.

5. A visual development environment provides programmers with tools to build substantial sections of a program by pointing and clicking.

6. Text editors and program editors provide a fine tool for programming software interfaces.

7. Syntax errors result from instructions that the computer can’t execute.

 

Vocabulary practice

 

1. Match up the words that are similar in meaning.

 

computation medium

bug scheme

to execute error, mistake

environment calculation

outline carry out

to launch instrument

tool to start (up)

 

2. Fill in the blanks choosing from the variants given.

1. Microsoft Visual Basic was one of the first programming languages to feature a visual development … .

a) medium b) environment c) tool

2. If program testing doesn’t produce the expected results, the program contains a (an) …, sometimes called a “...”.

a) mistake b) error c) problem d) bug

3. Program planning ... depends on the language and paradigm used to code a computer program.

a) instruments b) options c) tools

4. When the user … GUI application, the program interface appears on the screen and waits for the user to initiate an event by clicking a menu, dragging an object, or typing text.

a) starts up b) begins c) launches

5. A typical commercial program requires extensive planning, which includes detailed program … .

a) plans b) outlines c) schemes

6. Some runtime errors result from instructions that computer can’t ... .

a) execute b) make c) carry out

7. Programmers approach problems in different ways: while one programmer might focus on the steps to complete specific …, another programmer might focus on the data that forms the basis for the … .

a) tasks b) calculations c) computations

 

3. Make two-word combinations using the words in columns and then fill in the following sentences.

A: programming B: planning

problem error

runtime statement

structured manual

event driven

program paradigm

user English

 

1. Anyone who uses computers is familiar with program documentation in the form of ... and help files.

2 The process of coding a computer program depends on programming language you use, the programming tools you select, and the … that best fits the problem you are trying to solve.

3. The programming process begins with a … that helps you clearly define the purpose of a computer program.

4. Most GUI applications are …, which means that when launched, the program’s interface appears on the screen and waits for the user to initiate an event.

5. An assumption is something you accept as true in order to proceed with … .

6. There are different program planning tools, such as flowcharts, … pseudocode, UML diagrams, and decision tables.

7. … shows up when you run a program.

 

4. Fill in the gaps in the text.

Computer programmers focus on ___ computer programs, but also plan, test, and document computer programs. Before program code can be written, a programmer needs a clear problem ___, which includes a list of assumptions, a description of known information, and a specification for what constitutes a solution. With a clear plan, a programmer can begin coding using a generic text editor, a program editor, or a ___ development environment. A program is not complete until it has been tested to ensure that it contains no ___ errors or runtime errors. Programmers can use software called a ___ to step through a program. All computer programs should include internal documentation in the form of ___, which are explanatory comments inserted into a computer program along with lines of code.

 

Speaking. Discuss the following questions.

 

1. What is a problem statement?

2. What is an assumption?

3. Does the problem statement provide sufficient planning to begin coding?

4. How does a programmer code a computer program?

5. What is a text editor and a program editor?

6. What is a VDE?

7. How does a programmer know if a program works?

8. What can cause program errors?

9. How do programmers find errors?

10. Do computer programs contain any special documentation?

 

Text B

 

Pre-reading. Match the English words with their Russian equivalents.

 

Reading. Read the text and try to guess the meaning of the words in bold. Check your variants in the dictionary.


Date: 2015-01-12; view: 2399


<== previous page | next page ==>
Privacy | PROCEDURAL PROGRAMMING
doclecture.net - lectures - 2014-2024 year. Copyright infringement or personal data (0.008 sec.)