Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Oxford for Computing_1993.doc
Скачиваний:
0
Добавлен:
01.07.2025
Размер:
5.72 Mб
Скачать

Variables and the Declaration Statement

A variable is a quantity that is referred to by name, such as a, b, c, d, and

25 average in the above program. A variable can take on many values

during program execution, but you must make sure that they are given an initial value, as C does not do so automatically. However, before variables can be used in a program, they must be declared in a type declaration statement.

  1. The Function must appear only once in a program.

  2. /• CALCULATE AVERAGES V is a line.

  3. The statement float a,b,c,d,average; is a statement.

  4. The program below contains function statements.

  5. The assignment statements are on lines and

  6. The main part of the program is enclosed within .

  7. Each line of any C program must end with a , which acts as a

statement .

8 If you forget to include the correct punctuation, the will produce

a error.

9 A quantity referred to by name is known as a

10 A statement must be used to declare variables.

Task 12 Find words in the text which mean:

  1. brackets (lines 5-10)

  2. not fixed (lines 10-15)

  3. systematically check (lines 10-15)

  4. recognized (lines 15-20)

  5. completed (lines 2 0-2 5)

  6. starting (lines 2 5-2 9)

Task 13

The table below shows C's relational operators. Fill the gaps in the table.

C symbol

Meaning

equal to

equal to or less than

Task 14

Writing

Using the completed table above, write sentences to illustrate the following:

  1. a != b : :

  2. a>b

  3. a <= b

  4. a >= b

  5. a < b

  6. ci = = b

Task 15

Speaking

Read the statements below. Which do you agree with more? Why?

Learning a programming language is like learning any natural language. The only difference is that you are communicating with a machine instead of another person/

'I get annoyed when I hear people comparing programming languages with natural languages. They have almost nothing in common.'

47

Word-play

Task 16 Solve the anagrams in the right-hand column and match them with the words

in the left-hand column to complete the phrases. The first one has been done for you.

  1. high-level a mestnttae

  2. machine \ b thirmacite

  3. systems \ c peat

  4. object \ d taporeor

  5. linkage \ e omelud

  6. magnetic \ f egguanal language

  7. binary g trodite

  8. declaration h deco

  9. comment i enil

10 relational j nituroe

48

Language focus D

Organizing information

A paragraph is a group of related sentences that develop an idea. In nearly every paragraph, there is one idea that is more important than all the others. The main idea of the paragraph is usually found at the beginning.

Sample paragraph 1:

All computers, whether large or small, have the same basic capabilities. They have circuits for performing arithmetic operations. They all have a way of communicating with the person(s) using them. They also have circuits for making decisions.

In sample paragraph 1, the first sentence, All computers, whether large or small have the same basic capabilities, expresses the main idea of the paragraph.

All main idea sentences have a topic and say something about the topic.

Example:

All computers [topic], whether large or small have the same basic capabilities [about the topic].

In some of your reading, finding main ideas may serve your needs but, in much of your studying, you need to understand details. It is sometimes more difficult to understand details than main ideas. You will find it helpful if you think of details as growing out of the main idea. In sample paragraph 1, there are three major details growing out of the main idea. These are the major details:

  1. They have circuits for performing arithmetic operations.

  2. They all have a way of communicating with the person(s) using them.

  3. They also have circuits for making decisions.

A major detail often has minor details growing out of it. These minor details tell more about a major detail, just as major details tell more about a main idea. In studying, you often find a paragraph that has many small details that you must understand and remember. Breaking up a paragraph of this kind into its three components: the main idea, major details, and minor details will help you to understand and remember what it is about.

Sample paragraph 2:

It is the incredible speed of computers, along with their memory capacity, which makes them so useful and valuable. Computers can solve problems in a fraction of the time it takes man. For this reason, businesses use them to keep their accounts, and airline, railway, and bus companies use them to control ticket sales. As for memory, modern computers can store information with high accuracy and reliability. A computer can put data into its memory and retrieve it again in a few millionths of a second. It also has a storage capacity for as many as a million items.

49

If you were to organize this paragraph into its three components, it would look like this:

Main idea

Major details

Minor details

It is the incredible speed of computers, along with their

memory capacity, which makes them so useful and

valuable.

Computers can solve

Modern computers

problems much faster

can store information

than humans

with high accuracy

and reliability.

Businesses

Transport

A computer

It also has a

use them

companies

can put

storage

to keep

use them

data into

capacity

accounts.

to keep

its memory

for as many

track of

and

as a million

ticket

retrieve it

items.

sales.

again in

a few

millionths

of a

second.

In making a block diagram you don't have to write every word in the main idea sentence or in each of the detaU sentences.

Exercise 1 Practise finding the main idea, major details, and minor details by completing

the block diagram after reading the following paragraph.

The computer has changed the production of copy in the newspaper industry. There are three steps involved in the process: input, correction, and output. First, the computer numbers each story, counts words, and gives a listing of the length of each story. Then, a page is made up, advertisements are placed in, the copy is shifted or deleted, and corrections are made. Finally, the computer hyphenates words, and the result of all this is a newspaper page.

Main idea

Major details

Minor details

The computer has changed the production of copy in the newspaper industry.

50

Exercise 2 Practise finding the main idea, major details, and minor details by completing

the diagram after reading the following paragraph.

Railway companies use large computer systems to control ticket reservations and to give immediate information on the status of their trains. The computer system is connected by private telephone lines to terminals in major train stations, and ticket reservations for customers are made through these phone lines. The passenger's name, type of accommodation, and the train schedule is put into the computer's memory. On a typical day, a railway's computer system gets thousands of telephone calls about reservations, space on other railways, and requests for arrivals and departures. A big advantage of the railway computer ticket reservation system is its rapidity because a cancelled booking can be sold anywhere in the system just a few seconds later. Railway computer systems are not used for reservations alone. They are used for a variety of other jobs including train schedules, planning, freight and cargo loading, meal planning, personnel availability, accounting, and stock control.

Main idea

Major details

Minor details

Terminals for ticket reservations

Thousands of calls for reservations, space, arrivals, and departures

51

Computer software

Start-up

Task 1 Make a list of software products that you use (e.g. word processing,

spreadsheets, etc.). Are there some features of the products you never use? Are there any features missing?

Reading

T ask 2 In the magazine article which follows, a number of software developers express

their opinions on the future of software technology. Read the article and tick ( J ) the relevant boxes to show which opinions are expressed by the speakers.

Opinions

In general, customers are getting what they want.

In general, customers are not getting what they want.

Software is too complex.

Software is not complex enough.

Software developers know what users want.

Software developers don't know what users want.

/«/

a

a

a

a

a

a

a

D

a

a

a

a

a

D

a

a

Catherine Bull

investigates

This week: software

Software technology is getting more complicated. Developers have to cut through a jungle of computer languages, operating environments, and shifting standards to choose how they'll create their software. It's not an easy job. Software purchasers will have to live with the results for years to come. Which advances in software technology will prevail? Which ones will be just a flash in the pan?

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