OOP lab 7 task solution
#include <iostream> using namespace std ; class position { public: int x ; int y ; position (){ x = 0 ; y = 0 ; } position operator + ( position & p_any ){ position p1 ; p1 . x = this -> x + p_any . x ; p1 . y = this -> y + p_any . y ; return p1 ; } }; int main (){ position p1 ; cout<< "Enter the intial values of x and y cordinates: " ; cin>> p1 . x >> p1 . y ; position p2 ; cout<< "Enter the new values for x and y to be shifted: " ; cin>> p2 . x >> p2 . y ; position p3 ; p3 = p1 + p2 ; cout<< "The initial values were: " << p1 . x << " " << p1 . y <<endl; cout<< "The new values are: " << p3 . x << " " << p3 . y <<endl; } // from now onward this is the second task #in...