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
There are three required elements needed to connect to the internet: hardware, web browser, and __________.
malfutka [58]

Yes the answer is D.internet service.

7 0
3 years ago
Read 2 more answers
Jennine has a table that she has created in Word. She has removed all borders inside the table, but now she wants a box around t
Crazy boy [7]

Answer:

The steps to create table, hide boarder and show border around the whole table is given below.

Explanation:

<u>1. Create Table</u>

  1. Click on insert Tab
  2. In insert tab, Click on Table
  3. Select No. of row and columns to create the table

<u>2. Hiding Boarders</u>

  1. Click on Design Tab
  2. In table style section Choose the layout that have no boarder

<u>3. Add boarder Around table</u>

  1. Click on Design Tab
  2. Select whole table by clicking on Plus sign on the top right corner of table
  3. Click on arrow of boarders button in Boarders section in design tab
  4. Select the "outside boarder" option from the list

<em>By following above mentioned steps, jennnine can draw a boarder around the table to distinguish it from rest of the document.</em>

8 0
4 years ago
Write a program that reads an integer between o and 1000 and adds all the digits in the integer. For example, if an integer is 9
ale4655 [162]

Answer:

Answered below

Explanation:

#Program is written in Python programming language

digit = 0

sum = 0

num = int(input("Enter a number between 0 and 1000: ")

#Check that number is within the valid range

if num > 0 and num <= 1000:

while num != 0:

#Isolate each digit

digit = num % 10

sum = sum + digit

#Remove isolated digit from number

num = num/10

else:

print("Number is not within valid range")

#print total sum of digits

print(sum)

6 0
3 years ago
1. In the casino game of roulette, a ball is rolled around the rim of a circular bowl while a wheel containing 38 slots into whi
Sergio [31]

Answer:

0.474

Explanation:

Number of slots in the wheel = 38

Number of red slots = 18

Number of black slots = 18

Number of green slots = 2

The player decides to bet the ball will fall into one of the red slots.

The player has decides that the ball will fall into one of the red slots. Thus the probability that the player will win is $\frac{18}{38}$

Therefore, $=\frac{18}{38}$

                 = 0.474

4 0
3 years ago
Your mom found some optical drives that are labeled as "R." She asks you what that means. What do you tell her?
jeyben [28]

Recordable. You can write a file to one of these discs once, but after that it is read only (essentially ROM) and can not be changed

4 0
3 years ago
Other questions:
  • ____ occurs when data is entered into the computer.
    6·1 answer
  • Why would you use a topic web?
    7·2 answers
  • Stacey wants to change her document to landscape view instead of portrait. Jesse wants to change the scale of his document. Whic
    5·1 answer
  • The Task Manager cannot be used to turn Services on and off.<br> True or False?
    8·2 answers
  • This is not for school but how do I mark am answer brainliest?
    15·1 answer
  • Memory management is concerned with __________.
    14·1 answer
  • What is the term that is used to describe a computer system that could store literary documents, link them according to logical
    10·1 answer
  • Bộ mã I mã hóa được nhiêu kí tự
    12·1 answer
  • Usually a WAN covers no more than one building.<br> Group of answer choices<br> True<br> False
    15·2 answers
  • Which statement best characterizes under what circumstances you should add your social media profile to a resume? You should add
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!