Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
UP_Programmin_Language3.doc
Скачиваний:
99
Добавлен:
16.03.2015
Размер:
2.48 Mб
Скачать

Unit 4 programming languages

PREVIEW

Task 1. Study these sample sections of programs. Rank them from 1 (easiest to understand) tо 5 (most difficult to understand).

a TABLE FILE SALES

SUM UNITS BY MONTH BY CUSTOMER

ON CUSTOMER SOBTOTAL PAGE ВREAK

END

e A=0

X=1

INPUT Y

FOR X=1 TO 3

A=Y**X

PRINT A

NEXT X

END

b 0101001 1000010 0010100

1101110 11111111

d mov ah, 3Dh

mov al, 0

push cs

pop ds

c REPORT THE BASE SALARIES

BROKEN DOWN BY REGION

FOR MANAGERS IN ENGLAND

Task 2. Here is a list of language types used by programmers. Can you match any of the samples in Task 1 to this list?

  1. Natural language 3 Low-level language

  2. High-level language

READING

Task 3. Study active vocabulary

assembly language

язык ассемблера

to convert

преобразовывать, конвертировать

to compile

транслировать, компилировать

(преобразовывать исходные тексты программы в объектные модули)

compiler program

компилирующая программа

interpreter program

интерпретирующая программа

instruction

программа действий, команда

coded form

кодированный вид

machine-readable form

машиночитаемая форма

according to

согласно, соответственно

to convey

передавать, сообщать

control unit

блок управления

to improve

улучшать

machine-oriented language

машинно-ориентированный язык

strings of binary

строка двоичного представления

problem-oriented language

проблемно-ориентированный язык

feature

признак, свойство, особенность

efficiently

эффективно, успешно

portable

машинонезависимый, мобильный, переносной

markup language

язык разметки

scripting language

язык описания сценариев, скриптовый язык

to respond

отвечать, реагировать, срабатывать

acronym

аббревиатура, сокращение

to embed

встроить

inexperienced

неопытный, малоопытный

loop

цикл

programming environment

среда программирования, среда разработки

dialog box

диалоговое окно

toolbox

набор инструментов

to drag

переместить мышью, перетащить

to implement

выполнять, осуществлять

structured language

структурированный язык

to attach

вложить, присоединить

Task 4. Work in groups of four. Read and translate Part I, then two passages describing computing languages from Part II. Make notes in the table below the text. Then exchange information with other students in your group to complete the table.

Computing languages

Part I

Computer programs can be written in a wide variety of computer languages. The two main types of computer languages are low-level languages and high-level languages. Low-level languages operate faster, but are more difficult to write. They include: machine code – which consists entirely of 1s and 0s, assembly language – which uses mnemonics and numbers.

High-level languages are closer to human languages and are therefore easier to use. They include: C++ (C plus plus), Java, JavaScript, Visual Basic, and Delphi.

All computer programs, however, have to be converted into low-level machine code to be understood by a computer. Some languages can be compiled by a compiler program, which converts the whole program into machine code at one time. Other languages are interpreted by an interpreter program which converts the program into machine code one line at a time, as each line is required by the processor. A compiled program only needs to be compiled once, but an interpreted program needs to be interpreted every time it is used. Compiled programs are therefore faster than interpreted programs.

Let's assume that we have studied the problem, designed a logical plan (our flowchart or pseudocode), and are now ready to write the program instructions. The process of writing program instructions is called coding. The instructions will be written on a form called a coded form. The instructions we write will be recorded in a machine-readable form.

The computer cannot understand instructions written in just any old way. The instructions must be written according to a set of rules. These rules are the foundation of a programming language. A programming language must convey the logical steps of the program plan in such a way that the control unit of the CPU can interpret and follow the instructions. Programming languages have improved throughout the years, just as computer hardware has improved. They have progressed from machine- languages that use strings of binary 1s and 0s to problem-oriented languages that use common mathematical and/or English terms. There are over 200 problem-oriented languages. Let’s study the most common of them.

Part II

C++ was developed from the С language. It was designed as a systems programming language with features that make it easy to control the computer hardware efficiently. It was used to produce the Microsoft Windows operating system. It is portable, i.e. programs written in C++ can be easily adapted for use on many different types of computer systems.

HTML stands for Hyper Text Markup Language. It is a page description language used for creating webpages. HTML uses a system of tags to mark page links and formatting. For example, the tag <u> tells the program to start underlining a text. Although programs cannot be created using HTML, small programs can be embedded in HTML code using a scripting language like JavaScript.

Java is a programming language originally designed for programming small electronic devices such as mobile phones. It can run unchanged on any operating system that has a Java Interpreter program. Java is used for writing programs for the World Wide Web.

JavaScript is a simplified form of the Java language. It is powerful and easy to use. Scripts are small programs that can be used to perform simple tasks or tie other programs together. JavaScript is designed for use inside webpages. It can enable a webpage to respond to a mouse click or input on a form. It can also provide a way of moving through webpages and produce simple animation.

BASIC is the acronym for beginner's all-purpose symbolic instruction code. It was developed in Dartmouth College as an easy-to-learn programming language for students and inexperienced programmers. Its key design goal is simplicity. BASIC is one of the easiest programming languages to use. Some of the expressions used in the BASIC language are shown in the table below.

Expression

Meaning

RЕМ

remark (a note for the programmer)

PRINT

shows the value of a variable on the display screen

INPUT

waits for the user to input a value into a variable

DO WHILE condition instructions

LOOP

repeats the instructions while the given condition is true

END

marks the end of a program

BASIC has become a very popular language in systems where many users share the use of a computer through terminals and it has become a universal language for personal computers. The language BASIC is mathematically oriented, that is, its typical use is to solve problems of a mathematical nature. BASIC uses the following mathematical symbols:

/ - divide by ** - raised to the power of

* - multiply by (times)

Because BASIC programs are usually executed from a terminal or microcomputer where input is entered through a keyboard and printed output is relatively slow, problems of a business nature requiring large volumes of input-output data are usually not practical.

Visual Basic is a programming environment, not simply a language. It uses the language Basic, a simple language developed to make it easy for people to learn how to program. Visual Basic has predefined objects such as dialog boxes, buttons, and text boxes which can be chosen from a toolbox and dragged across the screen using the mouse and dropped into the required position. Basic programming code is attached to form a complete program. Visual Basic is used to write general purpose applications for the Windows operating system.

Pascal was invented in 1970 by Professor Niklaus Wirth of Zurich, Switzerland. It was named after the mathematician Blaise Pascal, who invented one of the earliest practical calculators. Pascal is a mathematically oriented programming language and, as such, is most commonly used in mathematics, engineering, and computer science departments of colleges and universities. This language is somewhat unusual in that it was designed to be a structured language. This means that the program must be written in logical modules which are in turn called by a main controlling module. Much of Pascal’s popularity is due to work done at the University of California at San Diego, where Pascal has been implemented on several different computers including microcomputers.

Delphi is similar to Visual Basic. It is also a programming environment for developing programs for the Windows operating system. It has predefined objects that can be chosen from a toolbox. In Delphi, however, the code attached to the objects is written in a form of Pascal. You can think of Delphi as a kind of 'Visual Pascal'. Like Visual Basic, it is often used for general purpose programs.

Language

Associated

language

Type of

language

Use

C + +

HTML

Java

JavaScript

Basic

Visual Basic

Pascal

Delphi

Task 5. Read the text again and answer these questions.

  1. What is the difference between low-level and high-level languages?

  2. What is the foundation of any programming language?

  3. Which language uses a system of tags?

  4. What language was originally designed as a structured language?

  5. Which languages are designed to be used inside webpages?

  6. Which language was used to write the Windows operating system?

  7. What does Basic serve for?

  8. What does HTML stand for?

  9. Which languages can only be used in the Windows operating system?

  10. Which language cannot be used for writing programs?

Task 6. Are these statements true, false, or not mentioned in the text? Correct the false statements.

  1. High-level languages are faster and easier to use.

  2. A compiler is a special type of a computer program that translates a human readable text file into a form that can be more easily understood by the computer.

  3. Visual Basic and Delphi are programming environments developed for the Windows operating system.

  4. The instructions must be written in a machine-readable form.

  5. The programming languages have progressed from problem-oriented languages to machine-oriented languages.

  6. HTML tags that normally come in pairs are keywords surrounded by angle brackets.

  7. Java and Java Script are programming languages used inside webpages.

  8. Basic has become widely used and became popular mostly because of its portability to many platforms.

  9. Thanks to the implementation of Pascal on several different computers including microcomputers at the University of California at San Diego it gained much of its popularity.

Task 7. Give the Russian equivalents to the following words and phrases from the text. Choose five of them and make up sentences of your own. Read your sentences aloud for other students to translate.

All-purpose symbolic instruction code, to mark page link, programs are embedded into, to solve problems of a mathematical nature, to tie other programs together, large volumes of input-output data, to run unchanged on any operating system, to write general purpose applications, to show the value of a variable on the display screen, according to a set of rules, to drag across the screen, key design goal, to implement on different computers.

Task 8. Match the words and word-combinations on the left with the definitions on the right.

  1. high-level language

  1. a programming environment is based on the Pascal programming language and competes with Visual Basic.

  1. low-level language

  1. language that is close to the hardware.

  1. compiler program

  1. a special type of computer program that translates a human readable text file into a form that the computer can more easily understand. 

  1. interpreter program

  1. a simple language system designed to facilitate the writing of computer programs. 

  1. coding

  1. the language which has human sounding words and syntax (like words in a sentence)

  1. portable

  1. to run independently from an operating system.

  1. programming language

  1. the process of writing program instructions. 

  1. Java Script

  1. a programming environment from Microsoft.

  1. Visual basic

  1. the most popular scripting language on the internet that works in all major browsers.

  1. Delphi

  1. a computer program that executes instructions written in a programming language.

  1. C ++

  1. the computer programming language providing programmers with the advantage of being able to modify code without actually changing it.

Task 9. Translate the sentences into English using active vocabulary.

  1. Большинство веб-страниц создаются при помощи языка HTML.

  2. Программа компилятор преобразует код программы в машинный код и соединяет между собой элементы библиотек, используемые в программе.

  3. Код HTML скрыт от пользователя, когда он просматривает страницу в браузере.

  4. Паскаль – это математически-ориентированный язык программирования общего назначения, названный в честь выдающегося французского математика Блеза Паскаля.

  5. Имеется большой объем входных и выходных данных, значительная часть которых хранится на магнитных носителях.

  6. С помощью данного языка программирования можно писать универсальные приложения как для планшетов, так и для смартфонов.

  7. Visual Basic корпорации Microsoft – это среда программирования, используемая для создания графических приложений для операционных систем семейства Microsoft Windows.

  8. Java Script – объектно-ориентированный скриптовый язык программирования, разработанный для использования внутри веб-страниц.

  9. Подобно Visual Basic, Delphi поддерживает использование компонентов – заранее заданных объектов, которые могут быть выбраны из панели инструментов и перемещены мышью на экран.

  10. Используя оператор <<, вы можете отображать на экране текстовые строки, а также значения переменных различных типов.

LISTENING

Task 10. Study this fragment of a Basic program. What do you think this program is for?

10 REM AVERAGES

20

30 PRINT ‘TYPE 999 ТО INDICATE END OF DATA'

40

50 SUM= 0

60

70 PRINT 'PLEASE ENTER A NUMBER'

80

90 DO WHILE NUMBER <>999

100

110 COUNTER=COUNTER+1

120

130 INPUT NUMBER 140

150

  1. PRINT 'THE AVERAGE OF THE NUMBERS IS:'; AVERAGE

170

Task 11. Now listen to the recording to complete the missing lines in the program.

Task 12. Study the completed program. It contains three faults. Can you find them?

PROBLEM-SOLVING

Task 13. Using the information in the text and the table in Task 4, decide which languages would be best for these users and tasks.

  1. A language for students learning to program for the first time.

  2. A language for professional programmers who want their software to run on any type of computer system.

  3. A language for a student who wants to create his / her own webpage.

  4. A language for a website designer who wants to include simple animation in a site.

  5. A language for computing students who want to write a general purpose program as a college project.

WRITING

Task 14. Look back at the notes you made in the table in Task 4. Write a brief summary of the reading texts based on your notes.

Language

Associated

language

Type of

language

Use

C + +

С

Programming

General and systems programming

Example: C++ is a programming language. It is used for general and systems programming.

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]