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
What does the clone tile command do?
Angelina_Jolie [31]
It allows you to create tiled copies of an object while tweaking the variables
5 0
2 years ago
Read 2 more answers
Consider sending a stream of packets from host a to host b using ipsec. typically, a new sa will be established for each packet
nordsb [41]

Consider sending a stream of packets from Host A to Host B using Ipsec. Typically, a new SA will be established for each packet sent in the stream. True or False? Tweet Answer FALSE. REASON: Ipsec SA is first connect with Host A and Host B. So, all packets in the stream use the new SA.

8 0
2 years ago
Gregory Yob is associated with which of these games?
DiKsa [7]

Answer:

Gregory Yob is associated with Hunt the Wumpus.

Explanation:

Hunt the Wumpus was developed in 1973 by Gregory Yob and was one of the first games where the player can move around a series of interconnected controls.

please mark brainliest it really helps :)

3 0
3 years ago
Read 2 more answers
Use the drop-down menus to complete statements about the Quick Steps function.
Sloan [31]

Answer:

  1. pray the god for your answer

Explanation:

I lllllllllllllll believe the Jesus

7 0
2 years ago
The letters a, e, i, o and u are the only vowels. Write a function named vowelUseDict() takes a string t as a parameter and comp
Andru [333]

Please specify the programming language.


3 0
3 years ago
Other questions:
  • Write a function called ReverseLetters that takes an input phrase consisting of a single word and reverses the sequence of lette
    15·1 answer
  • Reflexes are basically "hard-wired" into the CNS. Anatomically, the basis of a reflex is an afferent neuron that synapses direct
    10·1 answer
  • This toolbar can be used to change the way the text in your presentation looks. Drawing
    5·2 answers
  • It will gain you more knowledge, intensify your soft skills, strong work ethics and grow your network. What is it?​
    12·2 answers
  • Which of the following controls will provide an area in the form for the user to enter a name? a. button b. label c. text box d.
    8·1 answer
  • Blank are back and forth movement of matter that create sound​
    15·1 answer
  • 1. What type of malware is triggered by a specific condition, such as a specific date or a particular user account being disable
    6·1 answer
  • Which 2 processes are operational processes
    10·1 answer
  • Fre.e points enjoy em
    7·2 answers
  • If there are over 1,000 websites about a certain topic, the information is reliable. A. True B. False
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!