Task 2. 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.


Task 3. 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)

Task 4. 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

 

Task 5. 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.

 

 

Task 6. 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?

 

 

Task 7. Read the text, write down the words you don’t know into your vocabulary and do the exercises below.

Text 15B. PROCEDURAL PROGRAMMING

The traditional approach to programming uses a procedural paradigm (sometimes called “imperative paradigm”) to conceptualize the solution to a problem as a sequence of steps. A program written in a procedural language typically consists of self-contained instructions in a sequence that indicates how a task is to be performed or a problem is to be solved.

A programming language that supports the procedural paradigm is called a procedural language. Procedural languages are well suited for problems that can be easily solved with a linear, or step–by-step, algorithm. Programs created with procedural languages have a starting point and an ending point.


The flow of execution from the beginning to the end of the program is essentially linear – that is, the computer begins at the first instruction and carries out the prescribed series of instructions until it reaches the end of the program.

An algorithm is a set of steps for carrying out a task that can be written down and implemented. An algorithm for a computer program is a set of steps that explains how to begin with known information specified in a problem statement and how to manipulate that information to arrive a solution. In a later phase of the software development process, the algorithm is coded into instructions written in a programming language so that a computer can implement it.

To design an algorithm, you might begin by recording the steps you take to solve the problem manually. The computer also needs the initial information, so the part of your algorithm must specify how the computer gets it. Next, your algorithm should also specify how to manipulate this information and, finally, how the computer decides what to display as the solution.

You can express an algorithm in several different ways, including structured English, pseudocode, and flowcharts. These tools are not programming languages, and they cannot be processed by a computer. Their purpose is to give you a way to document your ideas for program design.

Structured English is a subset of the English language with a limited selection of sentence structures that reflects processing activities. Another way to express an algorithm is with pseudocode. Pseudocode is a notational system for algorithms that has been described as a mixture of English and your favorite programming language.

A third way to express an algorithm is to use a flowchart. A flowchart is a graphical representation of the way a computer should progress from one instruction to the next when it performs a task.

Before finalizing the algorithm for a computer program, you should perform a walkthrough to verify that your algorithm works. To perform a walkthrough for a simple program, you can use a calculator, paper, and pencil to step through a sample problem using realistic “test” data.

For more complex programs, a walkthrough might consist of a verbal presentation to a group of programmers who can help identify logical errors in the algorithm and suggest ways to make the algorithm more efficient.

The algorithm specifies the order in which program instructions are performed by the computer. Unless you do otherwise, sequential execution is the normal pattern of program execution. During sequential execution, the computer performs each instruction in the order it appears – the first instruction in the program is executed first, then the second instruction, and so on, to the last instruction in the program.

Some algorithms specify that a program must execute instructions in an order different from the sequence in which they are listed, skip some instructions under certain circumstances, or repeat instructions. Control structures are instructions that specify the sequence in which program is executed. Most programming languages have three types of control structures: sequence controls, selection controls, and repetition controls.

A sequence control structure changes the order in which instructions are carried out by directing the computer to execute an instruction elsewhere in the program.


 A sequence control structure directs the computer to the statements they contain, but when these statements have been executed, the computer neatly returns to the main program.

A selection control structure, also referred to as a “decision structure” or “branch”, tells a computer what to do, based on whether a condition is true or false. A simple example of a selection control structure is the IF…THEN…ELSE command.

A repetition control structure directs the computer to repeat one or more instructions until certain condition is met. The section of code that repeats is usually referred to as a loop or “iteration”. Some of the most frequently used repetition commands are FOR…NEXT, DO…WHILE, DO…UNTIL, and WHILE…WEND (which means “while ends”).

All the first programming languages were procedural. The first widely used standardized computer language, FORTRAN, with its procedural paradigm set the pattern for other popular procedural languages, such as COBOL, APL, ALGOL, PL/1, PASCAL, C, ADA, and BASIC.

The procedural approach is best suited for problems that can be solved by following a step-by-step algorithm. It has been widely used for transaction processing, which is characterized by the use of a single algorithm applied to many different sets of data. For example, in banking industry, the algorithm for calculating checking account balances is the same, regardless of the amounts deposited and withdrawn. Many problems in math and science also lend themselves to the procedural approach.

The procedural approach and procedural languages tend to produce programs that run quickly and use system resources efficiently. It is a classic approach understood by many programmers, software engineers, and system analysts. The procedural paradigm is quite flexible and powerful, which allows programmers to apply it to many types of problems.

The downside of the procedural paradigm is that it does not fit gracefully with certain types of problems – those that are unstructured or those with very complex algorithms. The procedural paradigm has also been criticized because it forces programmers to view problems as a series of steps, whereas some problems might better be visualized as interacting objects or as interrelated words, concepts, and ideas.

 

 


Дата добавления: 2018-10-26; просмотров: 631; Мы поможем в написании вашей работы!

Поделиться с друзьями:






Мы поможем в написании ваших работ!