Problem 1
How many operands does each of the following types of operators require? _______ Unary _______ Binary _______ Ternary
Problem 2
How may the double variables temp, weight, and age be defined in one statement?
Problem 4
Write assignment statements that perform the following operations with the variables a, b, and c. A) Adds 2 to a and stores the result in b. B) Multiplies b times 4 and stores the result in a. C) Divides a by 3.14 and stores the result in b. D) Subtracts 8 from b and stores the result in a. E) Stores the value 27 in a. F) Stores the character ‘K’ in c. G) Stores the ASCII code for ‘B’ in c.
Problem 13
The following data 72 'A' "Hello World" 2.8712 are all examples of A) Variables B) Literals or constants C) Strings D) None of the above
Problem 14
A group of statements, such as the contents of a function, is enclosed in A) Braces {} B) Parentheses () C) Brackets <> D) All of the above will do
Problem 15
Which of the following are not valid assignment statements? (Circle all that apply.) A) total = 9; B) 72 = amount; C) profit = 129 D) letter = 'W';
Problem 19
The negation operator is A) Unary B) Binary C) Ternary D) None of the above
Problem 20
A(n) ___________ is like a variable, but its value is read-only and cannot be changed during the program’s execution. A) secure variable B) uninitialized variable C) named constant D) locked variable
Problem 21
When do preprocessor directives execute? A) Before the compiler compiles your program B) After the compiler compiles your program C) At the same time as the compiler compiles your program D) None of the above
Problem 22
A variable must be defined before it can be used.