{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

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

Info icon This 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)
Image of page 1

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

View Full Document Right 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;
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]
Image of page 3

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

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

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern