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
kobusy [5.1K]
4 years ago
6

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.
Computers and Technology
2 answers:
Svetradugi [14.3K]4 years ago
8 0

Answer:

#include <iostream>

using namespace std;

void CoordTransform(int *xVal, int *yVal) {

// since we have passed x and y by adress:

// any change in xVal or yVal will also change the value of x and y

*xVal = (*xVal + 1) * 2;

*yVal = (*yVal + 1) * 2;

}

int main() {

int x, y;

// geting x from user

cout << "Enter x: ";

cin >> x;

// getting y from user

cout << "Enter y: ";

cin >> y;

// passing x and y to function CoordTransform() by adress.

CoordTransform(&x, &y);

cout << "new x: " << x << endl;

cout << "new y: " << y << endl;

return 0;

}

Explanation:

a pointer points to a memory location of the veraible so, when we pass a veriable by adress to a function, any change at that memory location also effect the value of the veriable that is local to the calling function.  

NISA [10]4 years ago
3 0

Answer:

#include <iostream>

using namespace std;

void CoordTransform(int *ptr1, int *ptr2);

int main()

{

   int xVal;

int yVal;

cout<<"please enter two valid integers";

cin>>xVal;

cin>>yVal;

CoordTransform(&xVal , &yVal);

int xValNew=xVal;

int yValNew=yVal;

cout<<xValNew<<yValNew;

   

   return 0;

}

void CoordTransform(int *ptr1, int *ptr2)

{

int a = *ptr1;

*ptr1=(*ptr1+1)*2;

*ptr2=(*ptr2+1)*2;

}

Explanation:

It will return new values in previously defined variables

coding language: c++

You might be interested in
Construct a formula in cell D11 to calculate the sales tax amount for transaction 578. Be sure to appropriately reference the tr
Vlada [557]

Answer:

Explanation:

Formulas!D11: =C11*0.0675

4 / 7  (57.1%)

Feedback:

[-2] The formula in cell D11 does not reference the sales tax rate

[-1] The tax rate reference is not absolute

Copy the formula you used in cell D11 down to calculate the sales tax amount for the remaining transactions.

1 / 1  (100.0%)

Feedback:

Construct a formula in cell E11 to calculate the total amount for transaction 578. Be sure to appropriately reference the transaction amount in cell C11 and the sales tax amount in cell D11 so that you can reuse your formula to calculate the total for the remaining transactions.

Formulas!E11: =SUM(C11:D11)

6 / 6  (100.0%)

Feedback:

Copy the formula you used in cell E11 down to calculate the total for the remaining transactions.

2 / 2  (100.0%)

Feedback:

Use the SUM function to calculate the “Grand Total” in for all transactions in cell E24.

Formulas!E24: =SUM(E11:E23)

4 / 4  (100.0%)

7 0
3 years ago
5. What will be displayed when this program finishes running?
Vika [28.1K]

Answer:5 i think im not sure though

Explanation:

8 0
3 years ago
Read 2 more answers
Which user input device is used with a PDA? The user input device for a PDA is a (an) blank?
olchik [2.2K]
For latest models of Pocket Digital Assistant or handheld devices, a touch screen input with or without stylus is the main input hardware/device.

For the older models, keyboard or personalized keyboard is the input hardware for the device.
4 0
3 years ago
Read 2 more answers
Please need help ASAP will mark brainliest
Levart [38]

Answer:

x8 negakation with a false

3 0
3 years ago
A network limit, called the ____, can be placed on how many times any packet is copied.
fomenos

Answer:

hop limit

Explanation:

Hop limit (as called in IPV6), or Time to live (as called in IPV4) is one of the fields in data packet. It is used to limit the life time of a packet in a network by specifying the allowable limit on the number of hops for which a packet is allowed before being removed from the network. It prevents a network from holding a packet forever. So when a router receives a packet, before forwarding it, it decrements the packet's hop limit by 1. If the hop limit gets to zero, any router holding it will drop it rather than forwarding it. This will help remove the packet from the network.

<em>Hope this helps!</em>

3 0
3 years ago
Other questions:
  • In Java, a char variable is capable of storing any Unicode character. Write a statement that assigns the Greek letter ^ to a cha
    7·1 answer
  • Which describes how media and networks interact
    12·1 answer
  • The ........ tag is used to create a link to another document​
    9·1 answer
  • Help plz technological wuestion
    9·1 answer
  • Write MVCTester.java. When the program starts, the initial screen displays a button labeled "add", a blank text area, and a text
    14·2 answers
  • Which of the following is NOT true about simple machines?
    10·1 answer
  • What does the sign (#) mean in manuscript edpm<br> and also what does (DEL)
    15·1 answer
  • Why is experience in their own factory setting
    13·1 answer
  • How do you select from the insertion point to the beginning of the current line?
    5·1 answer
  • What is 4365 −3412 when these values represent
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!