Answer the following statements true (T) or false (F)
1. A C++ declaration introduces only an identifier's spelling and specifies its type.
2. A C++ declaration is a definition that also allocates storage for an identifier's value
(or function's body etc.).
3. The range of values for an int variable is from about 0 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.
5. In C++ you can assign an expression of type int to a variable of type double with
no problem.
1. True.
A declaration introduces the spelling and type, whereas a definition is a declaration that also allocates memory.
2. True.
A declaration introduces the spelling and type, whereas a definition is a
declaration that also allocates memory.
3. False:
The correct range is about –2 Billion to +2 Billion.
4. False.
Names should communicate to the human reader the meaning of the value.
These identifiers do not communicate the meaning of their values..
5. True.
Assignment from an integer type to a floating point type can lose
information and should be avoided. Some compilers will warn, others may give an error
message, but you should avoid this.
You might also like to view...
The composition of a Process Identifier can best be described as which one of the following?
A) Unique letter B) Random letter C) Unique number D) Alpha-numeric code
Fonts in individual placeholders or on specific slides can be changed on the ________ tab
A) View B) Format C) Home D) Design