Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit




COMSC 140 -> OBJECT ORIENTED C++

STUDY GUIDE FOR FINAL


The final will be worth 400 points.  While you are taking your exam, I will be quietly in the Zoom room in case you need to ask me a question.  The final will be open book, open notes, and open computer.  The questions are taken from test banks and each test has different questions.

The final will start promptly at 4:30 PM on Monday Dec 6.  Good luck!  This final should not take longer than 2 hours under any circumstance. There will be multiple choice questions, fill in the    blank, and short answer questions on Canvas.  There will be programs on Zylabs as well as an       extra credit problem.  If you do not complete your programs, zip your files, and upload to              Canvas for partial credit.

Templates:

Define and Use Both a Function Template and a class Template

What is the advantage of templates?  Should templates be placed in separate .h and .cpp files? Syntax and use of keywords template, class,  and  typename.

Duck Programming, data inference.

Recursion:

What is recursion?  What are the base cases in a recursive problem?

What is tail recursion?

Understand the Binary Search Algorithm:

1.     All the values in the left subtree are less than the value in the root node.

2.    All the values in the right subtree are greater than or equal to the root node.

3.    This rule applies recursively to each of the subtrees

Understand the search process for a binary search tree.

How does the stack work during recursion?

What is infinite recursion?

When do you use a recursive solution?

What are the three criteria in a recursive design?

Strings:

Understand string constructors.  Be able to use the concatenation operator +.

Be able to use both string getline(cin, slocation) and  getline(cin, slocation, deliminator). Why do you need getline?

When the C++ compiler compares strings using s1 <  s2, what rule is used?

How do you determine the number of elements in a string array?

What are the index positions in a single string?  String function length?

string class methods:  erase, insert, substr, at, find, and replace

Know the 5 different methods for initializing strings

Pointers:

Understand pointer arithmetic and syntax:  *, & and [ ]

Understand what is legal and illegal.

Increasing a pointer by 1 increases the pointers value by what?

New and delete syntax for arrays, releasing memory correctly

Function Overloading, Reference Variables, and Default Arguments:


What does and does not make signatures unique?

Understand the syntax and use of reference variables as well as default arguments. What is a reason for using reference variables to pass to a function?

Know how to pass by value, pass by reference, and pass using a pointer.

C++ classes and Object-Oriented Design:

Describe the characteristics of C++, Advantages and Disadvantages of C++.

When you design a class,  do you name classes with a noun, a verb, or an adjective? What is encapsulation?  What is class aggregation or containment?

What is an accessor or mutator function?  What is the default access mode for classes? How to make implicit and explicit calls, what is illegal?

What is the difference between a method and a free function?

In C++ class data should be represented as private, while the implementation is public. What is separate compilation?  What does a .h file and a .cpp file contain?

Inheritance, Virtual Functions, and Polymorphism:

Examples of Inheritance – IS A  and HAS A relationship

What are the advantages of inheritance? What is the “substitution principle”?                       Protected, private, and public data members, what does this imply for the programmer?    Protected, private, and public access for derived classes causes which data members to be accessed by the derived class.

Which data members are inherited from the base class by the derived class.

How do you access base class functions in derived class.

What is the definition of a virtual function and polymorphism?

What does the lack of a virtual function cause in a derived class with a redefined function? Overridden versus Redefined? What is an abstract base class?

What is the difference between static and dynamic binding.

The Standard Template Library:

What is the STL and why is it needed?  What is the advantage of using templates? What is the syntax for defining a template and instantiating the template?

List the characteristics, advantages and disadvantages of vector, list, and deque. What is the difference between a map and a set?

What is a set and a multiset?  How are elements stored?

How are maps, sets, multimaps and multisets sorted?

In maps distinguish between the key and the value.

For both maps and sets know how to place data in ascending or descending order.           Ascending is low to high.  Descending is high to low.  What is default for maps and sets?

What is the difference between an associative and sequence container?

What is the most useful STL?  What is the second most useful STL?

Know how to define and use an iterator to output data.

Be able to analyze code for vectors, maps, and sets.

Constructors and Destructors:

What is the purpose and format for the constructor initialization lists?

With multiple constructors, know which constructor gets called first.

When are constructors and destructors invoked and in what order?

What is the syntax for constructors and destructors?