Answer:
The following program is written in C++ Programming Language:
//header file
#include <iostream>
using namespace std; //using namespace
//set void type method
void CoordTransform (int xVal ,int yVal ,int& xValNew, int& yValNew) {
xValNew = (xVal +1) *2;
//here is the code
yValNew = (yVal +1) *2;
//
return;
}
//main method
int main() {
int xValNew = 0;
// initialize integer type variable
int yValNew = 0;
// initialize integer type variable
CoordTransform(3, 4, xValNew, yValNew);
// method definition
// print result
cout << "(3, 4) becomes " << "(" << xValNew << ", " << yValNew << ")" << endl;
return 0;
//return
}
Explanation:
In the following program, we can set the header file or using namespace.
Then, set void type function which is given in the question and write the following codes and close the function.
Then, set the main method, inside it, we initialize two integer type variable to 0.
Then, call the function and pass the value through the parameter.