Friend Keyword
🔖 Background Information
We are going to use some of the code examples from class to get some practice with friend functions in C++.
🎯 Problem Statement
Perform the actions outlined in the Acceptance Criteria.
✅ Acceptance Criteria
- Fork the
csc_122_friend_keyword
repository on GitHub so that you have your own copy of the code. - In the file called
1_getters.cpp
, create a new function calledswap
that will swap the height and width of aRectangle
. You should use getters and setters - use thescale
function as a guide. - In the file called
2_friend_functions.cpp
, create a new function calledswap
that will swap the height and width of aRectangle
. You should use the friend keyword - use thescale
function as a guide. - In the file called
3_friend_classes.cpp
, create a new class calledGeometricSwapper
. This class will swap the height and width of aRectangle
. You should use the friend keyword - use theGeometricScalar
class as a guide.
📋 Dev Notes
Turn in the assignment by copy / pasting the GitHub URL of your forked repository in this assignment.
🖥️ Example Output
N/A
📘 Works Cited
N/A