True False:
Comment required.
1. In C++ the variables Alpha, ALPHA and AlphA are the same identifier.
Answer: False.
Explanation: C++ is case sensitive, these are different identifiers.
2. In C++ the compiler will infer the type intended for a variable from the context in
which the variable occurs.
Answer: False.
Explanation: C++ requires every identifier to be declared prior to use. The type is
specified in the declaration.
3. The range of values for an int variable is from about 0 to +2 billion.
Answer: False:
Explanation: The correct range is about –2 Billion to +2 Billion.
4. The names x, y, and z are satisfactory variable names for the lengths of the legs and
hypotenuse of a triangle.
Answer: False.
Explanation: Names should communicate to the human reader the meaning of the value.
These identifiers do not communicate the meaning of their values..
5. Explanation: In general assigning a floating point value to an integer variable mostly
loses information. A warning message (or an error message) is issued by C++
compilers.
6. C++ uses only /* */ for comments.
Answer: False.
Explanation: C++ uses /* */ comments and // “here to the end of the line”
comments.
7. A program’s comments should connect the program code to the problem being
solved.
Answer: True.
Explanation: The purpose of comments in a program is to help the human reader of the
code to connect the program to the problem being solved. Comments are so important