Object Oriented Design - Practice Exam Problems | CSE 687, Exams of Engineering

Material Type: Exam; Professor: Fawcett; Class: Object Oriented Design; Subject: Computer Engineering; University: Syracuse University; Term: Spring 2004;

Typology: Exams

Pre 2010

Uploaded on 09/17/2009

koofers-user-jk0-1
koofers-user-jk0-1 🇺🇸

10 documents

1 / 13

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CSE687 Object Oriented DesignMidTerm Makeup Spring 2004
Midterm Makeup
This is a take-home examination, which you are expected to prepare
entirely yourself. You may, however, ask the instructor or any TA any
question you wish about the questions contained within. If you
complete all the questions flawlessly, your midterm grade will be
raised to 85.
The Makeup is due by May 7th, at Midnight. No later submissions will
be accepted. Note that your final project is due on April 26th, and no
project submissions will be accepted after May 3rd at midnight. All
projects will be subject to a late penalty, as described in class and on
the notices page of the web site.
pf3
pf4
pf5
pf8
pf9
pfa
pfd

Partial preview of the text

Download Object Oriented Design - Practice Exam Problems | CSE 687 and more Exams Engineering in PDF only on Docsity!

Midterm Makeup

This is a take-home examination, which you are expected to prepare

entirely yourself. You may, however, ask the instructor or any TA any

question you wish about the questions contained within. If you

complete all the questions flawlessly, your midterm grade will be

raised to 85.

The Makeup is due by May 7th, at Midnight. No later submissions will

be accepted. Note that your final project is due on April 26th, and no

project submissions will be accepted after May 3rd^ at midnight. All

projects will be subject to a late penalty, as described in class and on

the notices page of the web site.

1. Given the declarations:

class D : public B { … private: std::string s; std::istream &is; }

write a copy constructor for class D. You may assume there are

no other data members in class D.

3. Please describe how the Liskov Substitution Principle applies to

your Project #3, statement attached on last page.

4. Given the code fragments below, where the ellipsis (…)

represents code that has not been disclosed to you:

class X { … }; class Y { public: Y(const X& x); … };

what can you say about the compilation and execution of each of

the following statements? Describe all of the operations that

occur during execution.

X x1, x2;

Y y2 = x1;

Y y[4] = { x1, x2, X() };

6. Given the classes:

class A { public: virtual void fun1(int); virtual int fun2(); void

fun3(); … };

class B : public A { public: void fun1(int); virtual void fun4(); … }

show how you invoke fun4 using a pointer of type A*.

7. Define a base class B and two derived classes D1 and D2 so that

B provides a function, showTypes, that displays the type of B and

the type of any class that derives from B. a client uses the

function as shown below. B should not have to know the names

of the derived classes:

D1 d1; d1.showTypes(); // shows type of base and type of

d1;

D2 d2; d2.showTypes(); // shows type of base and type of

d2;

9. What is Object Oriented Design?

10. Implement a function that accepts an STL container and

provides to its client the maximum and minimum values in the

container. Your function must be able to accept more than one

type of container, say either a list or a vector, but you are

required to show only that it is correct for a vector. Under what

circumstances will your implementation fail to compile?

executive. That is, your server modules should satisfy the open/closed principle: they should be open for extension, but closed to modifications.