Студопедия

Главная страница Случайная страница

Разделы сайта

АвтомобилиАстрономияБиологияГеографияДом и садДругие языкиДругоеИнформатикаИсторияКультураЛитератураЛогикаМатематикаМедицинаМеталлургияМеханикаОбразованиеОхрана трудаПедагогикаПолитикаПравоПсихологияРелигияРиторикаСоциологияСпортСтроительствоТехнологияТуризмФизикаФилософияФинансыХимияЧерчениеЭкологияЭкономикаЭлектроника






Exercises






1. Read the International words and guess their meaning:

BASIC; PASCAL; original; popularity; popular; version; compiler; interpreter; dialect; authority; documentation; to ignore; block; parameters; syntactic; novelty; file; section; line; basic; to limit; interactive; calculator; principal; principle; structure; actions declaration

 

2. Pronounce the following words correctly:

solve [solv] v – решать; разрешать interactive [, intə r'æ ktiv] a – взаимодействующий; интерактивный time-sharing ['taim ƒ ε ə riη ] – с разделением времени widely ['waidli] adv – широко extremely [iks'tri: mli] adv – чрезвычайно version ['və: ƒ (ə)n] n – версия; вариант hand-held ['hæ ndheld] a – карманный; портативный easy ['i: zi] a – легкий; нетрудный conversational [, konvə 'seiƒ ə nl] a – разговорный implementation [, implimen'teiƒ n] n – реализация (языков); внедрение successor [s(ə)k'sesə ] n – преемник novelty ['nov(ə)lti] n – новизна; новинка; новшество afford [ə 'fo: d] v – предоставлять; давать inherent [in'hiə r(ə)nt] a – присущий; свойственный decipher [di'saifə ] v – расшифровывать coherently [ko(u) 'hiə r(ə)ntli] adv – логически связано concern [kə n'sə: n] v – касаться; иметь отношение remove [ri'mu: v] v – удалять; перемещать cassette [kə 'set] n – кассета ignore [ig'no: ] v – игнорировать valuable ['væ ljuə bl] a – ценный; дорогостоящий propose [prə 'pouz] v – предлагать revise [ri'vaiz] v – пересматривать; перерабатывать suitable [ə 'sju: tə bl] a – подходящий; соответствующий heading ['hediη ] n – заглавие body ['bodi] n – основная часть; тело программы compulsory [kə m'pлls(ə)ri] a – обязательный identifier [ai'dentifaiə ] n – идентификатор

3. Memorize the following word combinations:

to become extremely popular – стать чрезвычайно популярным

the first-time programmer – программист-новичок

structured programming – структурное программирование

a general-purpose language – универсальный язык

 

TEXT A

HIGH LEVEL PROGRAMMING LANGUAGES:

BASIC & PASCAL

1. BASIC was developed in 1965 and stands for Beginners All-purpose Symbolic Instruction Code. It is a programming language designed for solving mathematical and business problems. BASIC was originally developed as an interactive programming language for time-sharing on large mainframes. It is widely used on all sizes of computers and has become extremely popular on microcomputers.

2. There are many different versions of BASIC available with limited versions running on small hand-held computers. BASIC is available in compiler and interpreter form, the latter form being more popular and easier to use, especially for the first-time programmer. In interpreter form the language is conversational and can be used as a desk calculator. In addition, it is easy to debug a program, since each line of code can be tested one at a time.

3. BASIC is considered to be one of the easiest, programming languages to learn. For simple problems BASIC programs can be written 'on the fly', at the terminal. However, complex problems require programming technique, as in any conventional programming language. Since BASIC does not require a structured programming approach, like PASCAL, and since there is no inherent documentation in the language, as in COBOL, BASIC programs can be difficult to decipher later if the program was not coherently designed.

4. BASIC is now used almost universally. There is no one" BASIC language, but something like 90 different versions or dialects; however, all have certain common featuresthatmake it easy to use any version once the fundamentals are mastered. Since BASIC is job and human oriented, it cannot be understood by the computer as written, but must go through the intermediate step of a compiler or interpreter, as was said above. As far as the programmer is concerned, it makes very little difference whether a compiler or interpreter is used.

5. A compiler, generally used in a large computer, converts the source program written in BASIC to an object program or file in machine language which is then stored in memory. In the compiler each BASIC phrase or statement is converted to one or more machine instructions. An interpreter is similar in result, but conversion is usually done while the program is running, one statement at a time. The difference between the two, which is important to the microprocessor user, is that the interpreter must be preset in memory while the program is being run; while the compiler can be removed once it has done its job.

6. One would think then that a microcomputer would most often use a compiler, but this is not the case. Since interpreter programs can be run line-by-line, they can be debugged simply rather that being recompiled for each correction, and they are more popular in small computers. In certain versions the interpreter is stored in ROM, which is less expensive than RAM, and does not need to be loaded from some external source such as a cassette.

7. The typical example of the algorithm in BASIC can be written as follows:

REM THIS PROGRAM SEARCHES A LIST AND PRINTS THE ADDRESS

10 DATA 74, 83, 66, 67, 87, 65, 84, 80, 76, 70

20 LET N=10

30 LET X=65

40 LET J=N

50 IF J=0 GOTO 100

60 READ К

70 IF K=GOTO 100 / 80 LET J-J—1

90 GOTO 50

100 PRINT J

110 ENDS

BASIC features the fact that every line is a statement and every statement must be preceded by a line number followed by space. Any statement on a line beginning with REM is ignored by the interpreter or compiler. However these REMarks may be extremely valuable in explaining the purpose and method of the program. Some BASIC variations use the apostrophe (') as an abbreviation for REM.

8. BASIC has various expressions (constants and variables combined by arithmetic and algebraic operators), line numbers, spaces, remarks, data, and statements. BASIC statements may be: LET statement which is the simplest kind of an arithmetic assignment statement, READ statement, GOTO statement, IF statement, IF THEN statement, etc. In the case of the IF statement we are interested in whether the relation between two expressions following the IF is TRUE or FALSE. In other words we are interested in the Boolean value of the expression following IF.

9. PASCAL. PASCAL is a general-purpose high level programming language. It is named after the famous French mathematician, Blaise Pascal, who in 1642 designed and built the first mechanical calculator, the " Pascaline". PASCAL is noted for its simplicity and structured programming design. It is available as both a compiler and an interpreter.

10. PASCAL was proposed and defined in 1971, and gained popularity in universities and colleges in Europe and " the United States. It was later revised and appeared as standard PASCAL in 1975. Its principal features are on teaching programming and on the efficient implementation of the language.

11. PASCAL may be considered a successor to ALGOL-60, from which it inherits syntactic appearances. The novelties of PASCAL lie mainly in extensive data structuring facilities such as record, set and file structures. It also affords more sophisticated control structures suitable to structured programming.

12. An algorithm of a computer program consists of two essential parts: a description of actions which are to be performed, and a description of the data, which are manipulated by these actions. Actions are described by statements, and data are described by declarations and definitions.

13. The program is divided into a heading and a body, called a block. The heading gives the program a name and lists its parameters. These are file variables and represent the arguments and results of the computation. The file output is a compulsory parameter. The block consists of six sections. They are: label declaration part, constant definition part, type definition part, variable declaration part, procedure and function declaration part, and statement part.

14. The first section lists all labels defined in this block. The second section introduces identifiers for constants. The third section contains type declarations, and the fourth— variable definitions. The fifth section defines procedures and functions. And the last, the sixth, gives the statements which specify the actions to be taken.

15. The statements used in PASCAL may be: EMPTY statement, GOTO statement, structured statement, compound statement, conditional statement, repetitive statement, WITH statement, etc. For example, IF statement: —IF expression THEN statement IF expression THEN statement ELSE statement.

Notes:

on the fly – с ходу; прямо

as far as – поскольку

this is not the case – это не так

line-by-line – построчно

remark – замечание; примечание; пометка

to inherit – перенимать

syntactic appearances – синтаксические признаки

empty – пустой

compound statement – составной оператор

conditional statement – условный оператор

repetitive statement – оператор цикла (повторений)

ELSE statement – оператор ИНАЧЕ

 

 






© 2023 :: MyLektsii.ru :: Мои Лекции
Все материалы представленные на сайте исключительно с целью ознакомления читателями и не преследуют коммерческих целей или нарушение авторских прав.
Копирование текстов разрешено только с указанием индексируемой ссылки на источник.