12.05.2015 Views

type - David Vernon

type - David Vernon

type - David Vernon

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Object-Oriented Programming<br />

Polymorphism and Reusability<br />

class line: public element {<br />

public:<br />

line (point &P, point &Q, element *ptr);<br />

void print() const;<br />

private:<br />

point A, B;<br />

};<br />

class circle: public element {<br />

public:<br />

circle (point &center, float radius, element *ptr);<br />

void print() const;<br />

private:<br />

point C;<br />

float r;<br />

};<br />

void pr(const point &P, const char *str=“, “);<br />

Copyright © 2007 <strong>David</strong> <strong>Vernon</strong> (www.vernon.eu)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!