• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 13 pages
Exam (elaborations)

Cs 3251 Exam 1 Updated Actual Questions And Correct Answers

Document preview thumbnail
Preview 2 out of 13 pages

CS 3251 EXAM 1 UPDATED ACTUAL QUESTIONS AND CORRECT ANSWERS Question: 1. encapsulation Answer: separates the implementation details from the public interface Question: 2. benefits of c++ data abstraction Answer: 1. data hiding 2. ability to declare multiple of the same object 3. automatic initialization and termination Question: 3. drawbacks of c++ data abstraction Answer: 1. error handling is obtrusive 2. function call overhead Question: 4. can arrays be initialized in BMI? Answer: yes Question: 5. member initialization list order Answer: 1. virtual base class sub-objects (no matter where they occur in hierarchy) 2. non-virtual immediate base classes in the order they appear in base class list 3. the class data members in order they are declared Question: 6. copy constructor Answer: initialize an object with a different object of the same type can be called with an = if you are making a new object (std::string s = t) Question: 7. assignment operator Answer: copies the value from one object to another of the same type

Content preview

CS 3251 EXAM 1 UPDATED ACTUAL QUESTIONS AND
CORRECT ANSWERS

Question:
1. encapsulation
Answer:
separates the implementation details from the public interface

Question:
2. benefits of c++ data abstraction
Answer:
1. data hiding
2. ability to declare multiple of the same object
3. automatic initialization and termination

Question:
3. drawbacks of c++ data abstraction
Answer:
1. error handling is obtrusive
2. function call overhead

Question:
4. can arrays be initialized in BMI?
Answer:
yes

Question:
5. member initialization list order
Answer:
1. virtual base class sub-objects (no matter where they occur in hierarchy)
2. non-virtual immediate base classes in the order they appear in base class list
3. the class data members in order they are declared

Question:
6. copy constructor
Answer:
initialize an object with a different object of the same type
can be called with an = if you are making a new object (std::string s = t)

Question:
7. assignment operator
Answer:
copies the value from one object to another of the same type

, Question:
8. shallow vs. deep copy
Answer:
shallow copies make copies of only the objects' references, not the actual objects
--> when original object is changed, new object also changes
deep copies make copies of the actual data and objects referred to by the original object
when object being copied only has data structures or primitives, shallow and deep are the same, but if there
are pointers they are different

Question:
9. the big 3
Answer:
destructor, copy constructor, assignment operator (operator=)

Question:
10. initialization vs. assignment
Answer:
initialization: the process of turning raw storage into an object
assignment: the process of replacing the existing state of a well-defined object with a new state (never
performed on raw storage)

Question:
11. stages of c++ compiler
Answer:
preprocessor compiler assembler linker

Question:
12. preprocessor (role, output, common errors)
Answer:
role: deletes comments, expands macros, replaces file includes and constants
output: individual translation units with headers included, comments removed, and macros tmpl. expanded
common errors: don't use macros or define constants, don't pollute namespace with C libraries, understand
how template instantiation works

Question:
13. compiler (role, output, common errors)
Answer:
role: takes code and produces architecture dependent assembly code; apply rules of c++
output: individual translation units in assemble code
common errors: type errors, syntax errors, grammar errors

Question:
14. assembler (role, output, common errors)
Answer:
role: translate assemble into platform specific machine code
output: individual translation units in machine code
common errors: none

Document information

Uploaded on
September 16, 2026
Number of pages
13
Written in
2026/2027
Type
Exam (elaborations)
Contains
Questions & answers
$12.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Sold
77
Followers
2
Items
10550
Last sold
3 days ago



Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions