Looking for trustworthy answers? Westonci.ca is the ultimate Q&A platform where experts share their knowledge on various topics. Get detailed and accurate answers to your questions from a dedicated community of experts on our Q&A platform. Connect with a community of professionals ready to help you find accurate solutions to your questions quickly and efficiently.

#include using namespace std;class Pair{public:Pair();Pair (int first, int second);Pair (int first);int accessFirst();int accessSecond();friend Pair operator+ (const Pair&, const Pair&);friend Pair operator* (const Pair&, int);friend istream& operator>>(istream&, Pair&);friend ostream& operator<< (ostream&, const Pair&);private:int f;int s;};Pair operator+ (const Pair& 1hs, const Pair& rhs){return Pair(1hs.f + rhs.f, 1hs.s + rhs.s);Pair operator* (const Pair& 1hs, int rhs){returnPair(1hs.f * rhs, 1hs.s * rhs);}istream& operator>> (istream& ins, Pair& second){char ch;ins >> ch;ins >> second.f;ins >> ch;ins >> second.s;ins >> ch;return ins;}ostream& operator<< (ostream& outs, constPair&second){outs << '(';outs << second.f;outs << ",";outs << second.s;outs <<")";returnouts;}Pair:: Pair(int firstValue, intsecondValue);f(firstValue),s(secondValue){}Pair:: Pair(int firstValue) :F(firstValue), s(0){}Pair:: Pair(): f(0), s(0){}int Pair::accessFirst(){return f;}int Pair::accessSecond(){return s;}int main(){Pair a(8,5);Pair b(2,3);Pair c(4,8);Pair d,x,y;cout<<"("<< c.accessFirst()<<","<< c.accessSecond()<<")"<