sample-final

sample-final - Introduction to Programming Systems Design...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
1 Introduction to Programming Systems Design CSCI 455 SAMPLE FINAL Dr. K. Narayanaswamy You have 2 hours (120 minutes) to complete this examination. Cell phones / laptops/ PDAs not allowed. You can use any and all printed reference materials – however, you will NOT be allowed to share any reference materials, including books, notes, etc. Each student must have his/her own reference materials. YOU MUST ANSWER all questions in both parts. Part I contains mostly objective questions worth 1 point each unless otherwise specified . Part II contains 6 questions, each worth 12 points. NAME: __________________ ______________ STUDENT ID: ___________________________ QUESTION MAXIMUM SCORE PART I 28 PART II Question 1 12 Question 2 12 Question 3 12 Question 4 12 Question 5 12 Question 6 12 TOTAL (100)
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2 PART I: Clearly MARK your answer. Ambiguous notations will not be given credit. Each question carries 1 point, unless otherwise specified. 1) The construct that supports inheritance in C++ is called: 1) function 2) enum 3) typedef 4) class 2) By default, all members of a class are and all members of a struct are : 1) public, public 2) public, private 3) private, public 4) private, private 3) Access to private functions of a class is available to: 1) only public members of class 2) any place the class is visible 3) only private member functions 4) all member functions 4) If a class provides a single constructor function, there are conditions under which it might not be called when a new object is created: TRUE / FALSE 5) Constructor function in C++: 1) May return void 2) Cannot take parameters 3) May return an object 4) Cannot return any value 6) Destructor function in C++ cannot: 1) Delete any attributes 2) Be overloaded 3) Delete protected members 4) Be defined inside the class 7) The most common kind of derivation in C++ programs as a whole is: 1) Protected derivation 2) Private derivation 3) Public derivation 4) Answer is impossible 8) When is the base class constructor called relative to the derived class constructor? 1) They are called together 2) Depends on kind of derivation 3) Derived class constructor first 4) Base class constructor first 9) When the compiler cannot find a member function in a class for a particular object, it will look for: 1) Any function matching that name 2) Least specific member function 3) Least general function possible 4) Any function that looks available class Polygon { public: Polygon (double ); ~Polygon (); Polygon (const Polygon &p); void print () const;
Background image of page 2
3 protected: double area; private: int id; }; 10) The function Polygon (double) is a class: [2 points] 1) constructor 2) destructor 3) copy constructor 4) none of these 11) Given the definition: Polygon p1(1.1); what values are passed to the constructor? [2 points] 1) 0.0 2) 1.1 3) area 4) none of these 12) Assume p1 of type Polygon in #11 is an automatic local variable. When the variable p1 goes out of scope, which function is automatically called? [2 points] 1) Polygon (double )
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/08/2009 for the course CSCI 455X taught by Professor Bono during the Fall '08 term at USC.

Page1 / 13

sample-final - Introduction to Programming Systems Design...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online