29 lines
612 B
C++
Raw Permalink Normal View History

2021-03-11 11:24:36 -05:00
#include <iostream>
using namespace std;
/* Your solution goes here */
/* Note how we put the reference bits in the function declaration
* instead of passing &var.
*/
void CoordTransform(int& xVal, int& yVal, int& xValNew, int& yValNew){
xValNew = (xVal + 1) * 2;
yValNew = (yVal + 1) * 2;
}
int main() {
int xValNew;
int yValNew;
int xValUser;
int yValUser;
cin >> xValUser;
cin >> yValUser;
CoordTransform(xValUser, yValUser, xValNew, yValNew);
cout << "(" << xValUser << ", " << yValUser << ") becomes (" << xValNew << ", " << yValNew << ")" << endl;
return 0;
}