100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4.2 TrustPilot
logo-home
Examen

Test Bank for Absolute C++ 6th Edition by Savitch,ISBN;9780133970784 All Chapters 1-20 Fully Covered |COMPLETE GUIDE A+|.

Puntuación
-
Vendido
-
Páginas
362
Grado
A+
Subido en
02-04-2025
Escrito en
2024/2025

Test Bank for Absolute C++ 6th Edition by Savitch,ISBN;9780133970784 All Chapters 1-20 Fully Covered With Verified Questions and Answers |COMPLETE GUIDE A+|.

Institución
Absolute C++ 6th Edition
Grado
Absolute C++ 6th Edition











Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Libro relacionado

Escuela, estudio y materia

Institución
Absolute C++ 6th Edition
Grado
Absolute C++ 6th Edition

Información del documento

Subido en
2 de abril de 2025
Número de páginas
362
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

Vista previa del contenido

N
U
Chapter 1 - Test Questions




R
These test questions are fill in the blank, multiple choice, and true-false. The multiple




SI
choice questions may have more than one correct answer. There is one matching




N
question. Mark all of the correct answers for full credit.




G
True False questions require an explanation in addition to the true/false response, and, if




BY
false, also require a correction.




TE
True False:

Comment required.




S
1. OOP is an acronym that means Object Oriented Programming.
Answer: True.
Explanation: OOP is currently popular and is a powerful programming technique for a
large class of problems.
2. C++ not only supports OOP but also supports other programming styles.
Answer: True.
Explanation: C++ supports OOP and traditional procedure oriented programming.
3. The namespace facility is a tool used that assists in the study of genealogy.
Answer: False.
Explanation: The namespace facility helps prevent the libraries from “preempting all the
good names,” and allows us to use names we want whether the library has used them.
4. In C++ the variables Alpha, ALPHA and AlphA are the same identifier.
Answer: False.
Explanation: C++ is case sensitive, these are different identifiers.
5. 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.
6. A C++ declaration introduces only an identifier's spelling and specifies its type.
Answer: True.
Explanation: A declaration introduces the spelling and type, whereas a definition is a

, N
Test Bank for Savitch Absolute C++ 6e Page 2




U
declaration that also allocates memory.




R
7. A C++ declaration is a definition that also allocates storage for an identifier's value




SI
(or function's body etc.).




N
Answer: True.




G
Explanation: A declaration introduces the spelling and type, whereas a definition is a




BY
declaration that also allocates memory.
8. The range of values for an int variable is from about 0 to +2 billion.




TE
Answer: False:
Explanation: The correct range is about –2 Billion to +2 Billion.




S
9. 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..
10. In C++ you can assign an expression of type int to a variable of type double with
no problem.
Answer: True.
Explanation: 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.
11. In C++ you can assign an expression of type double to a variable of type int with
no problem.
Answer: False.
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.
12. To put a character into a cstring constant that causes the output to continue on the
next line, insert the escape sequence \t into the string constant.
Answer: False.
Explanation: \t is the tab escape sequence. Use \n instead.
13. If we execute this code in an otherwise correct and complete program:
n = 1;


©2016 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved.

, N
Test Bank for Savitch Absolute C++ 6e Page 3




U
n = (n++) + (n++);




R
the value of n is guaranteed to be 3 after the second line executes.




SI
Answer: False.




N
Explanation: Some compilers may give the value 3. The result of such code is dependent




G
on the compiler implementation. The C++ Standard says such code is illegal, and the




BY
Standard says the results are undefined, meaning the compiler can do anything with it
that suits the compiler writer. One of my compilers gives the value 4 to n.




TE
14. If we execute the code fragment in an otherwise complete, correct program:




S
n = 1;
cout << n++ << " " << n++ << " " << n++ << endl;
the output is guaranteed to be 1 2 3.
Answer: False.
Explanation: The code is illegal because its execution depends on the order of evaluation
of arguments. Various compilers give different answers. One compiler this writer uses
gives 3 2 1.
15. C++ uses only /* */ for comments.
Answer: False.
Explanation: C++ uses /* */ comments and // “here to the end of the line”
comments.
16. 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
there is an aphorism, often quoted by expert programmers: “If the comments and the code
disagree, then both are probably wrong.
17. A program should have a comment on every line.
Answer: False.
Explanation: This would be satisfactory only on a very complicated assembly language
program for an inexperienced programmer.
18. Comments have no value whatsoever and do not belong in a program.


©2016 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved.

, N
Test Bank for Savitch Absolute C++ 6e Page 4




U
Answer: False.




R
Explanation: The purpose of comments in a program is to help the human reader of the




SI
code to connect the program to the problem being solved. Comments are valuable.




N
19. The most difficult programming language construct to learn to use properly is the




G
comment.




BY
Answer: True.
Explanation: How many comments and what should be in the comment is very hard to




TE
decide because these depend on who is the intended reader of the code (and comments).




S
20. A computer program is a set of instructions intended for only the computer to follow.
Answer: False.
Explanation: A computer program is also intended for human beings to read, and the
comments are intended to make this job easier.

Fill in the blank

1. In C++, a legal identifiers may contain these kinds of characters _______________,
______________, ______________
Answer: Letters, digits, underscore
Explanation: Some implementations allow a very few other characters such as $.
2. The C++ very nearly contains the ______ programming language as proper subset.
Answer: (the) C (programming language)
3. In C++, a variable that has been defined but not initialized may not be use as an
______. (l-value or r-value).
Answer: r-value
Explanation: The value of an uninitialized variable may not be fetched. C++ does not
enforce this. If an uninitialized variable’s value is fetched you get whatever value was left
in the memory location by a previous user. Note that the value is garbage in the
dictionary sense, It is not a random value.
4. Identifiers should at least give a hint to the human reader of the ________________
of the identifier in the context of the problem being solved.
Answer: Meaning

Explanation: Any identifier in a program that represents a quantity in a problem should


©2016 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved.
$16.89
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada

Conoce al vendedor

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
Nursingbytes West Virgina University
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
20
Miembro desde
9 meses
Número de seguidores
0
Documentos
536
Última venta
1 semana hace
NursingBytes: Test Banks &amp; Practice Exams

Looking for relevant and up-to-date study materials to help you ace your exams? NursingBytes has got you covered! We offer a wide range of study resources, including test banks, exams, study notes, and more, to help prepare for your exams and achieve your academic goals. What\'s more, we can also help with your academic assignments, research, dissertations, online exams, online tutoring and much more! Please send us a message and will respond in the shortest time possible. Always Remember: Don\'t stress. Do your best. Forget the rest! Gracias!

Lee mas Leer menos
5.0

2 reseñas

5
2
4
0
3
0
2
0
1
0

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes