1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Mila [183]
3 years ago
7

Define a function CoordTransform() that transforms its first two input parameters xVal and yVal into two output parameters xValN

ew and yValNew. The function returns void. The transformation is new = (old + 1) * 2. Ex: If xVal = 3 and yVal = 4, then xValNew is 8 and yValNew is 10.Sample program:#include using namespace std;int main() { int xValNew = 0; int yValNew = 0; CoordTransform(3, 4, xValNew, yValNew); cout << "(3, 4) becomes " << "(" << xValNew << ", " << yValNew << ")" << endl; return 0;}
Computers and Technology
2 answers:
Ugo [173]3 years ago
5 0

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.

elena-14-01-66 [18.8K]3 years ago
5 0

Define a function CoordTransform() that transforms its first two input parameters xVal and yVal into two output parameters xValNew and yValNew is as shown as the code below

<h3>Explanation: </h3><h3 />

Define a function CoordTransform() that transforms its first two input parameters xVal and yVal into two output parameters xValNew and yValNew.

The function returns void. The transformation is new = (old + 1) * 2.

Ex: If xVal = 3 and yVal = 4, then xValNew is 8 and yValNew is 10.

Prints:

(3,4) outputs (8,10)

(0,0) outputs (2,2)

Sample program:

#include using namespace std;int main() { int xValNew = 0; int yValNew = 0; CoordTransform(3, 4, xValNew, yValNew); cout << "(3, 4) becomes " << "(" << xValNew << ", " << yValNew << ")" << endl; return 0;}

Answer:

#include <iostream>

using namespace std;

<em>/ void CoordTransform(int *ptr1, int *ptr2);</em>

<em />

<em>int main()</em>

<em />

<em>{</em>

<em />

<em>   int xVal;</em>

<em />

<em>int yVal;</em>

<em />

<em>cout<<"please enter two valid integers";</em>

<em />

<em>cin>>xVal;</em>

<em />

<em>cin>>yVal;</em>

<em />

<em>CoordTransform(&xVal , &yVal);</em>

<em />

<em>int xValNew=xVal;</em>

<em />

<em>int yValNew=yVal;</em>

<em />

<em>cout<<xValNew<<yValNew;</em>

<em />

<em>   </em>

<em />

<em>   return 0;</em>

<em />

<em>}</em>

<em />

<em>void CoordTransform(int *ptr1, int *ptr2)</em>

<em />

<em>{</em>

<em />

<em>int a = *ptr1;</em>

<em />

<em>*ptr1=(*ptr1+1)*2;</em>

<em />

<em>*ptr2=(*ptr2+1)*2;</em>

<em />

<em>}</em>

/

void CoordTransform (int xVal ,int yVal ,int& xValNew, int& yValNew) {

xValNew = (xVal +1) *2;

yValNew = (yVal +1) *2;

return;

}

int main() {

int xValNew = 0;

int yValNew = 0;

CoordTransform(3, 4, xValNew, yValNew);

cout << "(3, 4) becomes " << "(" << xValNew << ", " << yValNew << ")" << endl;

return 0;

<em>}</em>

Learn more about a function CoordTransform() brainly.com/question/13709447

#LearnWithBrainly

You might be interested in
Explain the relationship between society and the technologies of using Earth's resources?
julsineya [31]
Earth is natural and technology has a thing that can make u sick
5 0
3 years ago
After selecting the Slide Master tab (within the View tab), which actions can a user take to configure a slide master?
myrzilka [38]

Answer:

Yes those are the correct order.

Explanation:

5 0
2 years ago
A(n) __________attack is designed to render the target unreachable by legitimate users, not to provide the attacker access to th
Nimfa-mama [501]
Denial of Service or Distributed Denial of Service.
3 0
3 years ago
1. what is the purpose of giving an id to an html element when using javascript?
bazaltina [42]

Answer:

It is also used by JavaScript to access and manipulate the element with the specific id.

3 0
2 years ago
6
Novosadov [1.4K]

Answer:

government and New Zealand

Explanation:

you can see the web site name the name is gov.nz ,gov mens- government and nz means new Zealand

thank you like us

8 0
2 years ago
Read 2 more answers
Other questions:
  • Briefly describe "SoftwareEngineering Framework". Do provide examples and diagrams wherenecessary.
    15·1 answer
  • Technological _____ is the term used to describe the merging of several technologies into a single device.
    13·1 answer
  • Given the commands below, what do they do? for (position = 1 through aList.getLength()/2) { a = aList.getEntry(aList.getLength()
    11·1 answer
  • Description A data retrieval tool that finds specified data within a database A collection of records All of the fields for a si
    7·1 answer
  • Advertising is organized around four distinct groups. The _____ group includes the photographers, the illustrators, video produc
    9·1 answer
  • 2.36 LAB: Warm up: Variables, input, and casting (1) Prompt the user to input an integer, a double, a character, and a string, s
    12·1 answer
  • 2. ¿Cuáles de los siguientes Software son lenguajes de Programación?
    10·1 answer
  • Write the correct statements for the above logic and syntax errors in program below.
    12·1 answer
  • Edhesive in JAVA Write a method that takes a String parameter. If the String has a double letter (i.e. contains the same letter
    13·1 answer
  • Giusp minfg gấp vs ạ đáp án thôi nhé
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!