vfuncslides - Outline Administrivia Inheritance Overview...

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

View Full Document Right Arrow Icon
Outline Administrivia Inheritance Overview Drawing Example EECS 280 Discussion Week 10: Virtual Functions Applied Week of March 18, 2008 Virtual Functions Applied
Background image of page 1

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

View Full DocumentRight Arrow Icon
Outline Administrivia Inheritance Overview Drawing Example 1 Administrivia 2 Inheritance Overview 3 Drawing Example Virtual Functions Applied
Background image of page 2
Outline Administrivia Inheritance Overview Drawing Example Administrivia Project 3 returned; run cases before requesting regrade Project 4 Due Tuesday, March 25, 11:59 PM (one week!) Start with test cases (do them now if you haven’t) Virtual Functions Applied
Background image of page 3

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

View Full DocumentRight Arrow Icon
Outline Administrivia Inheritance Overview Drawing Example Inheritance Revisited Inheritance A way to extend a class by creating a new class, called a subclass , that has all the functions and variables of the original class plus some extras and/or changes. Interface A class containing only pure virtual functions, meant to define a set of operations that subclasses must implement. Creates a contract between users of the interface and implementers. Virtual Functions Applied
Background image of page 4
Outline Administrivia Inheritance Overview Drawing Example Example from Project 4 Player class Player { public : v i r t u a l int bet ( / * . . . * / ) = 0; v i r t u a l bool draw ( / * . . . * / / * . . . * / } ; Virtual Functions Applied
Background image of page 5

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

View Full DocumentRight Arrow Icon
Outline Administrivia Inheritance Overview Drawing Example Possible Player Implementation UserInputPlayer class UserInputPlayer : public Player { : int bet ( / * . . . * / ) ; } ; UserInputPlayer : : bet ( / * . . . * / ) { bet ; cout << ”What ’ s the bet ?” endl ; cin >> return } Virtual Functions Applied
Background image of page 6
Outline Administrivia Inheritance Overview Drawing Example Motivation Last week different from project 4 Project 4 Player is uninterestingly simple design We’ll work through harder example Virtual Functions Applied
Background image of page 7

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

View Full DocumentRight Arrow Icon
Outline Administrivia Inheritance Overview Drawing Example The Problem Simple drawing program Create basic shapes Move, resize, etc. How to design? Virtual Functions Applied
Background image of page 8
Outline Administrivia Inheritance Overview Drawing Example The Problem Simple drawing program Create basic shapes Move, resize, etc. How to design? System libraries do graphics Virtual Functions Applied
Background image of page 9

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

View Full DocumentRight Arrow Icon
Outline Administrivia Inheritance Overview Drawing Example The Problem Simple drawing program Create basic shapes Move, resize, etc. How to design? System libraries do graphics We just handle events Virtual Functions Applied
Background image of page 10
Outline Administrivia Inheritance Overview Drawing Example Design First step: what things do want to work with? Virtual Functions Applied
Background image of page 11

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

View Full DocumentRight Arrow Icon
Outline Administrivia Inheritance Overview Drawing Example The Problem Simple drawing program Create basic shapes Move, resize, etc.
Background image of page 12
Image of page 13
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 04/04/2008 for the course EECS 215 taught by Professor Phillips during the Winter '08 term at University of Michigan.

Page1 / 36

vfuncslides - Outline Administrivia Inheritance Overview...

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

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