A local frozen yogurt shop uses the following class to calcu…
A local frozen yogurt shop uses the following class to calculate the price of a customer’s order. Each yogurt object has a variable to keep track of the ounces. You can add yogurt objects together to get a sum total of ounces for two or more orders of yogurt. Use the following class definition to answer the next few questions. class Yogurt { private: float ounces_; public: Yogurt(float oz) : ounces_(oz) {} float GetPrice() const; Yogurt operator+(const Yogurt& yogurt); friend ostream& operator
Read DetailsImplement the operator+ operator Takes a reference to a Yog…
Implement the operator+ operator Takes a reference to a Yogurt object as a parameter Adds the ounces of each object together Returns a Yogurt object with the updated ounces To be written as if in the implementation (.cpp) file 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