100% Zufriedenheitsgarantie Sofort verfügbar nach Zahlung Sowohl online als auch als PDF Du bist an nichts gebunden
logo-home
Test Bank - Absolute C++ 6th Edition (Savitch, 2015) 19,65 €   In den Einkaufswagen

Prüfung

Test Bank - Absolute C++ 6th Edition (Savitch, 2015)

 15 mal angesehen  0 mal verkauft
  • Kurs
  • Absolute C++ 6th Edition
  • Hochschule
  • Absolute C++ 6th Edition
  • Book

Test Bank - Absolute C++ 6th Edition (Savitch, 2015)

vorschau 4 aus 363   Seiten

  • 3. august 2024
  • 363
  • 2024/2025
  • Prüfung
  • Fragen & Antworten
  • Absolute C++ 6th Edition
  • Absolute C++ 6th Edition
avatar-seller
EMAIL US ON MEDTESTBANKS@GMAIL.COM
6th Edition
test bank


M
E D
Walter Savitch (Author), Kenrick Mock (Author)
Absolute C++

G
E E K
FOR MORE AFFORDABLE FILES CHECK OUT US ON: WWW.MEDTESTBANKS.COM

,Chapter 1 - Test Questions
These test questions are fill in the blank, multiple choice, and true-false. The multiple
choice questions may have more than one correct answer. There is one matching
question. Mark all of the correct answers for full credit.
True False questions require an explanation in addition to the true/false response, and, if
false, also require a correction.

True False:




M
Comment required.

1. OOP is an acronym that means Object Oriented Programming.




E
Answer: True.
Explanation: OOP is currently popular and is a powerful programming technique for a
large class of problems.
D
2. C++ not only supports OOP but also supports other programming styles.
G
Answer: True.
Explanation: C++ supports OOP and traditional procedure oriented programming.
E
3. The namespace facility is a tool used that assists in the study of genealogy.
Answer: False.
E

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.
K


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

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


declaration that also allocates memory.
7. A C++ declaration is a definition that also allocates storage for an identifier's value
(or function's body etc.).
Answer: True.
Explanation: A declaration introduces the spelling and type, whereas a definition is a
declaration that also allocates memory.
8. The range of values for an int variable is from about 0 to +2 billion.
Answer: False:




M
Explanation: The correct range is about –2 Billion to +2 Billion.
9. The names x, y, and z are satisfactory variable names for the lengths of the legs and




E
hypotenuse of a triangle.
Answer: False.

D
Explanation: Names should communicate to the human reader the meaning of the value.
These identifiers do not communicate the meaning of their values..
G
10. In C++ you can assign an expression of type int to a variable of type double with
no problem.
E
Answer: True.
Explanation: Assignment from an integer type to a floating point type can lose
E

information and should be avoided. Some compilers will warn, others may give an error
message, but you should avoid this.
K


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.

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

n = (n++) + (n++);
the value of n is guaranteed to be 3 after the second line executes.
Answer: False.
Explanation: Some compilers may give the value 3. The result of such code is dependent
on the compiler implementation. The C++ Standard says such code is illegal, and the
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.
14. If we execute the code fragment in an otherwise complete, correct program:




M
n = 1;
cout << n++ << " " << n++ << " " << n++ << endl;




E
the output is guaranteed to be 1 2 3.
Answer: False.

D
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
G
gives 3 2 1.
15. C++ uses only /* */ for comments.
E
Answer: False.
Explanation: C++ uses /* */ comments and // “here to the end of the line”
E

comments.
16. A program’s comments should connect the program code to the problem being
K


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.

Alle Vorteile der Zusammenfassungen von Stuvia auf einen Blick:

Garantiert gute Qualität durch Reviews

Garantiert gute Qualität durch Reviews

Stuvia Verkäufer haben mehr als 700.000 Zusammenfassungen beurteilt. Deshalb weißt du dass du das beste Dokument kaufst.

Schnell und einfach kaufen

Schnell und einfach kaufen

Man bezahlt schnell und einfach mit iDeal, Kreditkarte oder Stuvia-Kredit für die Zusammenfassungen. Man braucht keine Mitgliedschaft.

Konzentration auf den Kern der Sache

Konzentration auf den Kern der Sache

Deine Mitstudenten schreiben die Zusammenfassungen. Deshalb enthalten die Zusammenfassungen immer aktuelle, zuverlässige und up-to-date Informationen. Damit kommst du schnell zum Kern der Sache.

Häufig gestellte Fragen

Was bekomme ich, wenn ich dieses Dokument kaufe?

Du erhältst eine PDF-Datei, die sofort nach dem Kauf verfügbar ist. Das gekaufte Dokument ist jederzeit, überall und unbegrenzt über dein Profil zugänglich.

Zufriedenheitsgarantie: Wie funktioniert das?

Unsere Zufriedenheitsgarantie sorgt dafür, dass du immer eine Lernunterlage findest, die zu dir passt. Du füllst ein Formular aus und unser Kundendienstteam kümmert sich um den Rest.

Wem kaufe ich diese Zusammenfassung ab?

Stuvia ist ein Marktplatz, du kaufst dieses Dokument also nicht von uns, sondern vom Verkäufer MedGeek. Stuvia erleichtert die Zahlung an den Verkäufer.

Werde ich an ein Abonnement gebunden sein?

Nein, du kaufst diese Zusammenfassung nur für 19,65 €. Du bist nach deinem Kauf an nichts gebunden.

Kann man Stuvia trauen?

4.6 Sterne auf Google & Trustpilot (+1000 reviews)

45.681 Zusammenfassungen wurden in den letzten 30 Tagen verkauft

Gegründet 2010, seit 14 Jahren die erste Adresse für Zusammenfassungen

Starte mit dem Verkauf

Kürzlich von dir angesehen


19,65 €
  • (0)
  Kaufen