|
Variables and the Declaration StatementDate: 2015-10-07; view: 787. À variable is à quantity that is referred to by name, such as à, b, ñ, d, and averagein the above program. À variable can take on many values during program execution, but you must make sure that they are given an initial value, as Ñ does not do so automatically. However, before variables can be used in à program, they must be declared in à type declaration statement.
1. The Function _______ must appear only once in à program. 2. /* CALCULATE AVERAGES */is à _______ line. 3. The statement float à,b,c,d,average; is à _______ 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 Ñ program must end with à _______, which acts as à statement _______. 8. If you forget to include the correct punctuation, the _______ will produce a _______ error. 9. À quantity referred to by name is known as à _______. 10. À _______ _______statement must be used to declare variables.
B Find words in the text which mean: 1. brackets 4. recognised 2. not fixed 5. completed 3. systematically check 6. starting Exercise 7.The table below shows Ñ's relational operators. Fill the gaps in the table.
Exercise 8.Using the completed table from Exercise 7, write sentences to illustrate the following: 1. a! = b 4. a >= b 2. a > b 5. a < b 3. a <= b 6. a = = b Exercise 9.Read the statements below. Which do you agree with more? Why? 'Learning à programming language is like learning any natural language. The only difference is that you are communicating with à machine instead of another person.'
'I get annoyed when I hear people comparing programming languages with natural languages. They have almost nothing in common.'
Exercise 10. Word-play
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 is done for you.
1. 2. machine b. thirmacite 3. systems c. peat 4. object d. taporeo 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
|