Task. Draw a flowchart for one of these activities. Follow these steps:



1. Choose a simple procedure from the ones in the box below (or a simple one of your own).

2. Break the procedure down into all the steps that you have to follow. Think about where the process starts and ends, and the input from you and from the outside. When you make a decision, think of when you say ‘yes’ and when you say ‘no’, and what happens next.

3. Write exactly what happens at each stage.

4. Draw the flowchart, putting your text into the different shapes.

5. Show your flowchart to another student. Does he/she agree with your steps?

 

· Making a cup of tea or coffee · Making a telephone call · Sending a text message · Answering the door · Doing the translation of the text · Planning a holiday · Choosing a new computer · Preparing for an important exam · Making a proposal · Getting to the University

 


UNIT 15

PROGRAMMING

Vocabulary Bank Unit 15

Task 1. Memorize the following words and word-combinations:

 


1. a form design grid

2. add-on (n)

3. assumption

4. bug

5. computation

6. constant

7. debugger

8. downside

9. event-driven

10. event-handling code

11. flow of execution

12. gracefully

13. inadequate

14. initial

15. iteration

16. language-specific symbols

17. loop

18. multiple

19. outline (n)

20. predefined

21. programming paradigm

22. pseudo code

23. regardless

24. remarks

25. repetition control structure

26. runtime error

27. screen-based object

28. self-contained

29. sequence of steps

30. step-by-step

31. structuring

32. to arrive a solution

33. to deal with

34. to define

35. to launch a program

36. user manuals

37. VDE (visual development environment)

38. verbal presentation

39. walkthrough

40. well-documented program



Introductory reading

Text 15 A. PROGRAM PLANNING

Computers are controlled by sets of instructions called programs. Programs are written by a person called a programmer using special languages called programming languages.Programs can be written in a variety of computer languages. The language chosen will depend on a number of factors including what system the program will run on, what the function of the program is, and the knowledge of the programmer.

Programming is the process of preparing a set of coded instructions which enables the computer to solve specific problems or to perform specific functions. The essence of computer programming is the encoding of the program for the computer by means of algorithms. The thing is that any problem is expressed in mathematical terms; it contains formulae, equations and calculations. Any problem must be specially processed for the computer to understand it, that is – coded or programmed.

The phase in which the system's computer programs are written is called the development phase. The programs are lists of instructions that will be followed by the control unit of the central processing unit (CPU). The instructions of the program must be complete and in the appropriate sequence, or else the wrong answers will result. To guard against these errors in logic and to document the program's logical approach, logic plans should be developed.

There are two common techniques for planning the logic of a program. The first technique is flowcharting.

A flowchart is a plan in the form of a graphic or pictorial representation that uses predefined symbols to illustrate the program logic. It is, therefore, a "picture" of the logical steps to be performed by the computer. Each of the predefined symbol shapes stands for a general operation. The symbol shape communicates the nature of the general operation, and the specifics are written within the symbol. Flowcharts have arrowheads to indicate the direction of program flow and special symbols to indicate different functions in the program.

The second technique for planning program logic is called pseudocode. Pseudocode is an imitation of actual program instructions. It allows a program-like structure without the burden of programming rules to follow. Pseudocode is less time-consuming for the professional programmer than is flowcharting. It also emphasizes a top-down approach to program structure.

Pseudocode has three basic structures: sequence, decision, and looping logic. With these three structures, any required logic can be expressed.

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.

 

 


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

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






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