Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Английский Косова.doc
Скачиваний:
27
Добавлен:
30.05.2020
Размер:
3.95 Mб
Скачать

Structured languages

You've already learned something about the BASIC language. You will prob­ably go on someday to learn other programming languages as well. Different languages are designed for different purposes. BASIC is an all-purpose language, meaning that you can do almost anything in BASIC. But some things will be rather hard to do in BASIC. For example, although you have seen how to write programs with a top-down structure in BASIC, other languages make it easier to write such structured—or modular— programs.

Logo is a structured language that is often taught in schools and is avail­able for many microcomputers. You may be familiar with Logo because many schools use it to do "turtle graphics. "A turtle is a cursor on the screen. It's called a turtle because it is often shaped like one. You can tell the turtle to move left, right, up, down, or turn a certain number of degrees. You can see the turtle move on the screen. The turtle can also draw on the screen. If you tell it to put its pen down, it traces a line as it moves, or it can pick up the pen and not draw a line. (There are also mechanical turtles that move on the floor.)

Logo is a language that can help you to write structured programs. For example, in Logo you can tell the turtle to carry out a set of commands that draws a rectangle on the screen. Then you can call that set of commands "box." Each time you tell the turtle to "DO BOX," it will draw the rectangle. "Box" has become a module of a program. You can create a whole series of routines that draw different shapes or parts of pictures. Then you can combine them all in one statement and call the whole thing "house." Then you can make "house" part of another routine, and so on. Your whole program can consist of a series of statements defining different routines and then a few statements calling these routines in the correct order.

Logo doesn't just do turtle graphics, it is a complete language. But whether you use the language to draw a house or compute complex mathematical functions, the modular structure of the language is the same.

Pascal is also a structured language. Pascal has some features that make structured programming easier. For example, it allows you to indent the statements in a loop so that you can see the beginning and the end of each loop. Pascal also has certain requirements that make you plan your program carefully. For example, it requires you to define all your variables before you begin.

One disadvantage of Pascal is that it is often a compiled language. A compiled language is one that must be translated by a compiler into code that the computer can understand before the program can be run.

**Task VI. Answer the following questions on the text:

  1. What language do you use to write a modular program?

  2. What computer language is often taught at schools?

  3. What is “a turtle” ? What can you tell the turtle to do?

  4. How can Logo help you to write structured programs?

  5. What kind of language is Logo?

  6. In what way does Pascal make structured programming easier?

  7. What is one of disadvantages of Pascal?

***Task VII. Look through the text and make your own definitions of the terms:

  1. a compiled language

  2. a complete language

  3. a structured language

**Task VIII. Rewrite the following sentences, use the equivalents instead of modal verbs:

1). This language can make structured programming easier.

2). You must write a modular program.

3). He ought to follow the order.

4). You may use my computer for some time.

5). People couldn’t perform such calculations so quickly ten years ago.

6). You must save this data externally.

7). I can carry out different operations with the help LOGO.

8). He had to use modular structure, as the program was complex.

Programming

**Programming languages

Programming is the process of writing a program using a computer language. A program is a set of instructions which a computer uses to do a specific task (e.g. a solution to a Maths problem).

The only language a PC can directly execute is machine code, which consists of Is and Os. This language is difficult to write, so we use symbolic languages that are easier to understand. For example, assembly languages use abbreviations such as ADD, SUB, MPY to represent instructions. The program is then translated into machine code by software called an assembler.

Machine code and assembly languages are called low-level languages because they are closer to the hardware.

High-level languages, however, are closer to human languages; they use forms resembling English, which makes programming easier. The program is translated into machine code by software called a compiler. Some examples are:

  • FORTRAN - used for scientific and mathematical applications

  • COBOL - popular for business applications

  • BASIC - used as a teaching language; Visual BASIC is now used to create Windows applications

  • C - used to write system software, graphics and commercial programs

  • Java - designed to run on the Web; Java applets are small programs that run automatically on web pages and let you watch animated characters, and play music and games.

The languages used to create Web documents are called markup languages; they use instructions (markups) to format and link text files. Examples are:

  • HTML - the code used to create Web pages

  • VoiceXML - it makes Internet content accessible via speech recognition and phone. Instead of using a web browser on a PC, you use a telephone to access voice-equipped websites. Yoi just dial the phone number of the website and then give spoken instructions, commands, am get the required information.

Steps in writing a program

To write a program, software developers usually follow these steps.

  • First they try to understand the problem and define the purpose of the program.

  • They design a flowchart, a diagram which shows the successive logical steps of the program.

  • Next they write the instructions in a high-level language (Pascal, C, etc.I. This is called coding. The program is then compiled.

  • When the program is written, they test it: they run the program to see if it works and use special tools to detect bugs, or errors. Any errors are corrected until it runs smoothly. This is called debugging, or bug fixing.

  • Finally, software companies write a detailed description of how the program works, called program documentation. They also have a maintenance program. They get reports from users about any errors found in the program. After it has been improved, it is published as an updated version.

** Match the terms from A opposite with their definitions.

machine code

assembly language

high-level language

Java applet

compiler

markup language

a basic language which consists of binary codes

b programming language such as C, Java or Visual Basic

c writing computer programs

d low-level language translated into machine code by an assembler

e software which converts a source program into machine code

f language used to create and format documents for the Web

g small self-contained program written in Java

**Look at B and then put these programming steps into the correct order.

Document and maintain the program

Test the program and detect bugs

Make flowchart

Write code and compile

Analyze the problem

Debug and correct it if necessary

**Complete this article about the VoiceXML application language with the words from the box.

HTML

dial

VoiceXML

commands

speech recognition

***Internet: Voice recognition takes off

You don't need a sophisticated cell phone to surf the Internet when you're on the road - just your own voice. That's the idea behind a new breed of voice service that is popping up all over the place.

Subscribers (1) ……………. a toll-free phone number and use spoken (2) …………….. to listen

to anything from weather conditions to stock quotes, or flight information to news stories. Half a dozen of these services - such as Audiopoint, Be Vocal, TellMe and TelSurf Networks - have already gone live or are testing their systems.

These launches are all happening because two crucial technologies have come of age.

(3) ………………………….. software from companies such as Lucent, Nuance and

Speechworks can now understand a wide range of accents and diction without having to be trained to a specific voice. And computer languages such as VoiceXML make it as easy to write voice

services as (4) ……………….. has made it to write web pages. With (5) ………………… , the human voice becomes a substitute for a computer mouse and the spoken command for a click. It doesn't, however, call up conventional web pages, but content which is specially composed for a telephone.- sound clips, numbers, music, spoken texts.

Соседние файлы в предмете Английский язык