Final Exam, CSCI 230, Fall 2008
- The weight for each question is given with the question.
- Use as much paper as you wish, but make your answers are legible.
- Please answer each question thoughtfully and carefully.
- [5 points] Define Abstract Data Type (ADT)
- [5 points] What is information hiding? How is this supported in C++
- [4 points] What is a class in C++?
- [6 points] Name three different types of member functions, explain what each does.
- [10 points] Create a simple EmptyDouble class. This class is initialized to empty, but can be set to hold a double. Implement methods
- Create an instance that is empty
- Create an instance which holds a double.
- MakeEmpty() marks the variable as empty
- IsEmpty() returns true if the variable is marked as empty.
- Set(double d), sets the value to d
- double Get(), returns the double value if it is set.
- [3 points] What does operator overloading mean.
Give an example.
- [5 points] What is a linked list? Give an example and draw a picture.
- [5 points] Compare and contrast linked lists and arrays.
- [3 points] Declare a struct that can be a node in a linked list.
- [5 points] Using the struct from the previous question, write a recursive routine to insert a node into an ordered linked list.
- [9 points] When using dynamic memory in a class, what three methods should be implemented? Describe each and tell what each does.