Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

CSE687 Object Oriented Design Midterm #4 - Spring 2004 - Prof. James Fawcett, Exams of Engineering

A set of questions related to object-oriented design, focusing on inheritance, function declarations, deferred binding, liskov substitution principle, uml class diagrams, graph representation, singleton design, string-like class, copy constructor, and interface segregation principle.

Typology: Exams

Pre 2010

Uploaded on 08/09/2009

koofers-user-l50-1
koofers-user-l50-1 🇺🇸

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CSE687 Object Oriented Design Midterm #4 Spring 2004
1. Given the class declaration:
class X : public Y { … };
What can you say about the global function declarations on the
left? What will happen when they are each compiled or invoked as
shown on the right?
myFun1(Y y); myFun1(X());
myFun2(Y& y); myFun2(X());
myFun3(const Y& y); myFun3(X());
2. Why is deferred binding important?
3. Given the class declarations:
class A
{
public: virtual void mf1(int); virtual int mf2(); void mf3(); …
};
class B : public A
{
public: int mf2(); virtual void mf4(); …
};
What constraints on the unspecified code, shown by the ellipses …,
are necessary to ensure that the Liskov Substitution Principle is
satisfied?
4. Sketch a UML class diagram that represents your design of a
network-based digital library. That is, the program supports the
display of brief descriptions of indexed items, organized into
categories. It also supports the downloading of items from the
library. You don’t need to know anything about network
programming or windows programming for this task. Just focus on
the design aspects of the question.
5. Write a declaration for a class that represents a graph. A graph
consists of a collection of nodes, connected to one-another by
edges. Usually a node is connected to only a few of the other
nodes within the graph. Each node and each edge have an
associated type, specified by the user of the class.
pf3

Partial preview of the text

Download CSE687 Object Oriented Design Midterm #4 - Spring 2004 - Prof. James Fawcett and more Exams Engineering in PDF only on Docsity!

  1. Given the class declaration: class X : public Y { … }; What can you say about the global function declarations on the left? What will happen when they are each compiled or invoked as shown on the right? myFun1(Y y); myFun1(X()); myFun2(Y& y); myFun2(X()); myFun3(const Y& y); myFun3(X());
  2. Why is deferred binding important?
  3. Given the class declarations: class A { public: virtual void mf1(int); virtual int mf2(); void mf3(); … }; class B : public A { public: int mf2(); virtual void mf4(); … }; What constraints on the unspecified code, shown by the ellipses …, are necessary to ensure that the Liskov Substitution Principle is satisfied?
  4. Sketch a UML class diagram that represents your design of a network-based digital library. That is, the program supports the display of brief descriptions of indexed items, organized into categories. It also supports the downloading of items from the library. You don’t need to know anything about network programming or windows programming for this task. Just focus on the design aspects of the question.
  5. Write a declaration for a class that represents a graph. A graph consists of a collection of nodes, connected to one-another by edges. Usually a node is connected to only a few of the other nodes within the graph. Each node and each edge have an associated type, specified by the user of the class.
  1. How would you design a class so that all users can access only a single instance?