Which of the following is the correct prototype for a functi…
Which of the following is the correct prototype for a function with the following criteria: Is an overloaded – (subtraction symbol) operator Is a member function Has a Balance object as an operand on both sides of the operator Returns a new Balance object
Read DetailsThe following Region class is used to measure regions for la…
The following Region class is used to measure regions for laying carpet. Each region has a length and width. You can add regions together to get a sum total of the area needed to calculate the carpet needed for a room. Use the following class definition to answer the next few questions. class Region { public: Region(float length, float width): length_(length), width_(width) {} float GetArea() const; float operator+(const Region &r); friend std::ostream &operator
Read DetailsImplement the operator+ operator Takes a reference to a Reg…
Implement the operator+ operator Takes a reference to a Region object as a parameter Calculates and returns the area of two Region objects To be written as if in the implementation (.cpp) file Example: Region 1 area: 32 Region 2 area: 8 Region 1 + Region 2 = 40 (or 32 + 8) Don’t forget: Associate the function with the class (3 points) Correct use of the parameters/variables (3 points) Correct calculations & data types (4 points)
Read Details