Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Unit_1_Computer_Applications[1].doc
Скачиваний:
427
Добавлен:
11.02.2016
Размер:
12.51 Mб
Скачать

Exercise 3. These are answers to questions about the text. Write the questions.

  1. No, it is quite wordy so it is used for commercial purposes.

  2. To support the UNIX operating system.

  3. An applications program.

  4. It is done by the compiler.

  5. It fetches required systems routines and links them to the object module.

  6. No, they are also sold by other vendors.

Exercise 4. Summarize the information on different high-level computer languages by completing the table below.

Language

Developed

Function

Characteristic

FORTRAN

1959

Mathematical and scientific purposes

Combines features of COBOL and ALGOL

BASIC

To support Unix operating system

1962

Exercise 5. Choose the correct word to complete each sentence. You may have to change some words slightly.

1 instruction, instruct, instructed, instructor

  1. Our maths _______ explained to us the principles of binary arithmetic .

  2. We were _______ to document our programs very carefully.

  3. Both _______ and data have to be changed to machine code before the computer can operate on them.

2 compilation, compiler, compile, compiled

  1. Our university computer does not have a РАSСАL _______.

  2. Usually, а programmer _______ his program before he puts in the data.

  3. А source program cannot be directly processed by the computer until it has been _______.

3 result, results, resulting

  1. The linkage editor links systems routines to the object module. The _______ program, referred to as the load module, is directly executable by the computer.

  2. The _______ of these mathematical operations were obtained from the university mainframe and not from my micro.

4 specification, specify, specific, specified, specifically

  1. Our company bought three packages with very _______ applications: рауroll, accounts receivable, and accounts payable.

  2. An applications program is designed to do а _______ type of work, such as calculating the stress factor оf а roof.

  3. Did the analyst give the new programmer the _______ necessary to start on the project?

Exercise 6. Reading.

A Read the program and the text below, then complete the sentences which follow.

/* CALCULATE AVERAGES */

main( )

{

float а,b,с,d, average;

printf("Enter three numbers:");

scanf ("%f %f, %f ,&a, &b, &c);

d=a+b+c;

average = d/3. 0;

printf(“The average is %f”, average);

}

Comment Lines

А С source program consists of statements and comment lines. Comment lines are enclosed by the characters /* (at the start of thе comment) and */ (at the end of the comment).

The Function main{ }

Every С program must have a function called main which must аррeаr only once in a program. The parentheses following the word main must bе present, but there must be no parentheses included. The main part of the program is enclosed within braces { }, and consists declaration statements, assignment statements, and other С functions. In the above program there are six statements within the braces: а declaration statement (the first statement of the main program starting with the word float), two assignment statements (the fourth and fifth statements starting with the variable names d and average), and three function statements, two to print information on the screen and one to scan the keyboard for input.

As С is а free form language, the semicolon (;) at the end of each line is а must. It acts as а statement terminator, telling the compiler where an instruction ends. Free form means that statements can be identified and blank lines inserted in the source file to improve readability, and statements can span several lines. However, each statement must be terminated with а semicolon. If you forget to include the semicolon, the compiler will produce an error, indicating the next line as the source of the error. This can cause some confusion, as the statement objected to can be correct, yet as а syntax error is produced.

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