Compléter Practice ProgrammingVersion en ligne Practice Programs par Liz Smith 1 endl newX int return namespace int int Point temp temp Print newY x pt Print move iostream new pt x cout p main int int moving location Purpose : pass a struct to a function and return a struct variable #include / / for standard i / o using std ; / / reserve library objects for standard use / / declare the Point to represent a 2D point struct Point { ; / / the x coordinate int y ; / / the y coordinate } ; void ( ) ; / / to print a point in the format of ( x , y ) Point ( Point , , ) ; / / to move a point to a new location int ( ) { Point pt = { 1 , 2 } ; / / the given point / / display the point before moving << " Before , = " ; Print ( pt ) ; cout << endl ; / / move the point to ( 3 , 6 ) pt = move ( pt , 3 , 6 ) ; / / display the point after moving cout << " After moving , pt = " ; ( ) ; cout << ; / / successfully done return 0 ; } void Print ( Point p ) / / to print a point { cout << " ( " << . << " , " << p . y << " ) " ; / / print the format of ( x , y ) } Point move ( Point p , , ) / / to move a point { / / point temp ; / / temp . x = newX ; / / temp . y = newY ; Point = { newX , newY } ; / / a temporary point at a ; }