Chapter_CircleClass

Chapter_CircleClass - Extra Chapter OBJECT ORIENTED...

This preview shows pages 1–18. Sign up to view the full content.

Extra Chapter OBJECT ORIENTED PROGRAMMING – Circle Class

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

View Full Document
2 CIRCLE OBJECT EXAMPLE Point Class Review: Class statement for Advance Point object
3 CIRCLE OBJECT EXAMPLE Point Class Review: Implementations of all other Methods (Member Functions) in Point class Implementations of Constructors in Point class

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

View Full Document
4 CIRCLE OBJECT EXAMPLE Circle Class Statement: Constructors in Circle class Member variables Other methods in Circle class
5 CIRCLE OBJECT EXAMPLE Constructors’ Implementations: creates Circle object with unit radius, center at the origin Point object is passed three double variables are passed

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

View Full Document
6 CIRCLE OBJECT EXAMPLE Implementations of other Methods: Finds diameter Finds area Finds circum- ference
7 CIRCLE OBJECT EXAMPLE Implementations of other Methods: Checks if passed Point is inside calling Circle Checks if calling Circle has larger radius than passed Circle Checks if calling Circle and passed Circle overlap

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

View Full Document
8 CIRCLE OBJECT EXAMPLE Implementations of other Methods: Moves center point of calling Circle centerAt overload Shrinks (k<1)or Stretches (k>1) Pints center point and radius of calling Circle print() Method from Point class
9 CIRCLE OBJECT EXAMPLE Main Function 2.5 y 2 x p1

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

View Full Document
10 CIRCLE OBJECT EXAMPLE Main Function y 2 x p1 0.5 y 0.25 x p2 y x 0 0 1 radius c1 - 6 center
11 CIRCLE OBJECT EXAMPLE Main Function y x 0 0 1 radius y x 2 2.75 radius c1 c2 - 6 center center

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

View Full Document
12 CIRCLE OBJECT EXAMPLE Circle :: print ( ) y x 0 0 1 radius y x 2 2.75 radius c1 c2 - 6 center center
13 CIRCLE OBJECT EXAMPLE Circle :: print ( ) y x 0 0 1 radius y x 2 2.75 radius c1 c2 - 6 center center

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

View Full Document
14 y x 0 0 1 radius y x 2 2.75 radius c1 c2 - 6 CIRCLE OBJECT EXAMPLE Circle :: print ( ) center center
15 CIRCLE OBJECT EXAMPLE Circle :: print ( ) y x 0 0 1 radius y x 2 2.75 radius c1 c2 - 6 center center

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

View Full Document
16 CIRCLE OBJECT EXAMPLE Circle :: print ( ) y x 0 0 1 radius y x 2 2.75 radius c1 c2 - 6 center center
17 CIRCLE OBJECT EXAMPLE Circle :: area ( ) y x 0 0 1 radius y x 2 2.75 radius c1 c2 - 6 center center

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/05/2011 for the course CGS 2421 taught by Professor Onal during the Fall '09 term at University of Florida.

Page1 / 38

Chapter_CircleClass - Extra Chapter OBJECT ORIENTED...

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

View Full Document
Ask a homework question - tutors are online