SoftwareEng - Software Engineering Preliminary Examination...

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

View Full Document Right Arrow Icon
Software Engineering Preliminary Examination February 2009 Below is a list of sample exam questions to help you prepare for the Software Engineering Preliminary Exam. The questions provided do not cover every topic addressed by the exam. Be sure to review all topics identified in the preliminary exam syllabus prior to attempting the software engineering preliminary exam. (1) Provide a complete explanation of the differences between the terms class , object , and client . (2) Given the code segment below, answer the following three questions . class Alpha class Bravo : public Alpha { { public: public: Alpha(); Bravo(); void Charlie(); void Foxtrot(); private: private: int Delta; float Gamma; int Echo(); void Helo() } ; } ; If a variable of type Bravo is created, which, if any, constructors are called and in what order? An object of type Alpha has _______ member functions directly accessible by a client program? An object of type Bravo has _______ data attributes directly accessible by a client program? (3) In the context of C++, explain the differences between direct and indirect addressing. You must include C++ examples of each, in addition to your explanation, to receive full credit. (4) Describe the Slicing Problem and how it may be overcome in C++. Be sure to include sample C++ code that illustrates both the problem and the solution to the problem. (5) For the code segment below, describe the role of the operator on Line2 and the * operator on Line3 . int x = 5; // Line 1 int* y = &x; // Line 2 cout << *y; // Line 3 (6) Describe the difference between static and dynamic binding. (7) What term is used to describe to pool of memory locations used for dynamic allocation/deallocation? (8) Give two reasons why one might wish to pass an object by reference. (9) Suppose that class A has a private member X , a protected member Y , and a public member Z . A new class B is derived from A . Circle the visibility/accessibility of each inherited member within
Background image of page 1

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

View Full DocumentRight Arrow Icon
class B : public A member X : public protected private inaccessible { member Y : public protected private inaccessible }; member Z : public protected private inaccessible (10) Given the following code segment, answer the two questions below: int* ptr1 = new int; // Line 1 int* ptr2 = new int; // Line 2 *ptr2 = 44; // Line 3 *ptr1 = *ptr2; // Line 4 ptr1 = ptr2; // Line 5 delete ptr2; // Line 6 ptr2 = NULL; // Line 7 Which line creates an inaccessible object ? Which line creates a dangling pointer ? You must correctly explain your answers to receive full credit. (11) Overload the << operator for the Fraction class. Example: the fraction three-fourths should output as 3 / 4 class Fraction { public: Fraction(int num, int denom) { n = num; d = denom; } private: int n; // Numerator int d; // Denominator }; Fraction X(3, 4); Fraction Y(5, 6); cout << X << “ + “<< Y ; // Sample use of overloaded << operator (12) Explain the differences between reference types and pointer types in C++. (13)
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/02/2012 for the course COMPUTER 101 taught by Professor Dr.kahan during the Spring '11 term at Akademia Ekonomiczna w Krakowie.

Page1 / 47

SoftwareEng - Software Engineering Preliminary Examination...

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

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