CMP1025 Tutorial 2
CMP1025 Tutorial 2
_________________________.
repetition.
f) When it is not known in advance how many times a set of statements will be repeated, a(n)
________________________ value can be used to terminate the repetition.
g) A synonym for procedure is ______________________________.
h) A variable that accumulates the sum of several numbers is a(n) _________________________ .
i) Setting certain variables to specific values at the beginning of a program is called
______________________.
j) A special value used to indicate “end of data entry” is called a(n) _____________________, a(n)
d) Test if the value of the variable count is greater than 10. If it is, print “Count is greater than 10.”
h) Print the value 123.4567 with 2 digits of precision. What value is printed?
i) Print the floating-point value 3.14159 with three digits to the right of the decimal point. What
value is printed?
b) Initialize variable x to 1.
d) Add variable x to variable sum and assign the result to variable sum.
e) Print "The sum is: " followed by the value of variable sum.