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 */ 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 20-25)
6 starting (lines 25-29)
Task 13 The table below shows C's relational operators. Fill the gaps in the table.
Writing Using the completed table above, write sentences to illustrate the following: 1a!= b | |||
Task 14 | |||
2a > b 3 a <= b 4a >, b 5a < b 6a = = b | |||
Speaking
Task 15 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 >=thing in common.'
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. |
high-level | a | mestnttae | ||
machine | b | thirmacite | ||
systems | c | peat | ||
object | d | taporeor | ||
linkage | e | omelud | ||
magnetic | f | egguanal | language | |
binary | g | trodite | ||
declaration | h | deco | ||
comment | i | enil | ||
relational | i | nituroe |
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.
If you were to organize this paragraph into its three components, it would look like this:
Main idea
Major details
Computers can solve problems much faster than humans.
Modern computers can store information with high accuracy and reliability.
Minor details | Businesses | Transport | A computer | |
use them | companies | can put | ||
to keep | use them | data into | ||
accounts. | to keep track of ticket sales. | its memory and retrieve it 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 detail 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
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. |
Terminals for ticket reservations |
Thousands of calls for reservations, space, arrivals, and departures |
Computer software
_.AMMNYNIMU.ia• | Start-up 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? | ||
Task 1 |
Reading In the magazine article which follows, a number of software developers expnions on the future of software technology. Read the article and tick (V) the relevant boxes to show which opinions are expressed by the speakers. | |
Task 2 |
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.
Catherine Bull investigate s | |
This week: software
4 I chose four well-known software developers and asked each to talk about current and future trends in software technology. Their comments reveal some common and diverse themes.