Overloads - UAH CPE 212 Fundamentals of Software...

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

View Full Document Right Arrow Icon
UAH CPE 212 Fundamentals of Software Engineering Agenda Class 5 Classes and Operator Overloads More on Classes Operator Overloading Key Concepts
Background image of page 1

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

View Full DocumentRight Arrow Icon
UAH CPE 212 Last Time Concept of a class Common attributes Basic class definitions and utilization Declaring data members and data functions Member selector operator
Background image of page 2
UAH CPE 212 Classes Again Topics Default Arguments Default Constructor (another way) Parameters Formal Placeholder Actual By Value and By Reference Const again Return values
Background image of page 3

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

View Full DocumentRight Arrow Icon
UAH CPE 212 Pass-by-value CALLING BLOCK FUNCTION CALLED sends a copy of the contents of the actual parameter SO, the actual parameter cannot be changed by the function. C++ Plus Data Structures Slide by Sylvia Sorkin, Community College of Baltimore County - Essex Campus
Background image of page 4
UAH CPE 212 Pass-by-reference sends the location (memory address) of the actual parameter can change value of actual parameter CALLING BLOCK FUNCTION CALLED C++ Plus Data Structures Slide by Sylvia Sorkin, Community College of Baltimore County - Essex Campus
Background image of page 5

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

View Full DocumentRight Arrow Icon
UAH CPE 212 Point Class Declaration // FILE: point.h // CLASS PROVIDED: Point (an ADT for a point on a two-dimensional plane) // // CONSTRUCTOR for the Point class: // Point(double initial_x = 0, double initial_y = 0) // Postcondition: The Point has been set to (initial_x, initial_y). // // MODIFICATION MEMBER FUNCTIONS for the Point class: // void shift(double x_amount, double y_amount) // Postcondition: The Point has been moved by x_amount along the x axis // and by y_amount along the y axis. // // void rotate90( ) // Postcondition: The Point has been rotated clockwise 90 degrees around // the origin. // // CONSTANT MEMBER FUNCTIONS for the Point class: // double get_x( ) const // Postcondition: The value returned is the x coordinate of the Point. // // double get_y( ) const
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 19

Overloads - UAH CPE 212 Fundamentals of Software...

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

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