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
Why does angular page look different after refresh.
alukav5142 [94]
Most of the web applications are written with SPA frameworks such as Angular, React, Vue.js, etc. The problem with these SPAs is that the single page is loaded in the browser once and then the framework will take care of all the routing among pages and gives the impression to the user that it is a multi-page application. When you refresh your page in the browser that single page called index.html is reloaded and you will lose the entire state of the application.
3 0
3 years ago
List 3 characteristics of the ideal encryption scheme
JulsSmile [24]
Three characteristics of an ideal encrytion scheme are:
1. The encryption sheme should be strong: the algorithm is imprevious to direct attack and attempts are derived.
2. The encryption scheme should create unique ciphertext from the same plaintext for each key permutation, among other traits.
3. It should take at least millions of years to break ideal encryption scheme, based on mathematical predictions.
6 0
3 years ago
Read 2 more answers
Algorithm and flowchart:- calculate d=a+b-c​
Keith_Richards [23]

Answer:

a=c

hope it helps

4 0
3 years ago
What report would best help identify potential browser issues with website traffic?
Bezzdna [24]

The question above has multiple choices:

<span>a)      </span>The Active Users report

<span>b)      </span>The New vs Returning report

<span>c)       </span>The Browser & OS report

<span>d)      </span>The Source/Medium report

The answer is c) The browser & OS report


The browser & OS report in Google analytics can be used to analyze the website consumption in various versions of operating systems and web browsers. You are able to compare metrics such as bounce rate, session duration, and pages/sessions to each browser or OS.






6 0
3 years ago
A document called a system requirements report describes the objectives for the information system.
kkurt [141]
A, true. Requirements describe the objectives of any assignment.
6 0
3 years ago
Other questions:
  • A field whose data type is ____ can store text that can be used as a hyperlink address
    5·1 answer
  • . What may happen if a large number of computer users are attempting to access a Web site at the same
    10·2 answers
  • When you send an echo request message with the ping program, a successful attempt will return a(n) ______ message.
    8·1 answer
  • Show a single view of an object, but show it in a way that makes it look 3-D, as your eye would see it.
    10·1 answer
  • Many of the special staff teams require leadership training, which is offered to staff with more than 1 year of service at Camp
    15·1 answer
  • Alternating Current or AC is better for use in ___________, while DC direct current is needed in _________ .
    15·2 answers
  • When RadioButton objects are contained in a group box, the user can select only one of the radio buttons on the panel.
    12·1 answer
  • When using Regedit to browse through the registry, the key that is highlighted is the ________, and its value entries are visibl
    5·1 answer
  • What is the<br>Way to<br>keep the tool<br>Screw​
    6·1 answer
  • Did you know a security hacker is someone who explores methods for breaching defenses and exploiting weaknesses in a computer sy
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!