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]
3 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]3 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]3 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
What do people in japan use to make anime
lions [1.4K]

software programming like adobe flash.

8 0
3 years ago
A laptop computer communicates with a router wirelessly, by means of radio signals. the router is connected by cable directly to
Hoochie [10]
The answer would be 2500 Bits
4 0
3 years ago
How are natural systems and engineered systems similar to one another?
erastovalidia [21]

They get the idea from nature and then the make engineered systems.That is how they are similar.

4 0
3 years ago
Name the technique that uses a scheme to sum the individual digits in a number and stores the unit's digit of that sum with the
Artemon [7]

Answer:

Parity Bit

Explanation:

Given that Parity bit is a form of strategy or method that utilizes a scheme in adding a solitary bit to a binary string. This can be either 1 or 0, thereby making the total quantity of bit to become either odd parity bit or even parity bit during storage.

Hence, the technique that uses a scheme to sum the individual digits in a number and stores the unit's digit of that sum with the number is called PARITY BIT.

7 0
2 years ago
The Web team you manage is designing a new Website for a company that wants to reach a specific audience. After discussing the c
____ [38]

Answer:

Cultural diversity

Explanation:

Cultural diversity can be described as having a variety of cultures in the same area.

Culture on its own means beliefs, customs, and traditions of a specific group of people. It simply means the way of life of a people.

Cultural diversity usually fosters cultural unity in most cases becsuse the different cultures always tend to do everything together.

The design plan that encourages the use of two or more languages and the use of a recommended colour in creating a webpage in a place that has multiple ethnic groups is cultural diversity approach. As this puts into consideration all the cultures in its design.

4 0
2 years ago
Other questions:
  • Your bank contacts you asking you to phone a number supplied in the email.What do you?
    13·2 answers
  • Add is a function that accepts two int parameters and returns their sum.
    8·1 answer
  • 13. You're expecting an important call from Mr. Suarez, a potential customer. While waiting for this call, your supervisor calls
    15·1 answer
  • ICT excel data homework
    10·1 answer
  • A ____ operating system should be capable of supporting the applications and tools necessary to support Internet operations.
    10·1 answer
  • Write a program that takes the radius of a sphere (a floating-point number) as input and then outputs the sphere’s: Diameter (2
    7·1 answer
  • Eight what makes one character
    14·1 answer
  • Write a function to output an array of ints on a single line. Funtion Should take an array and an array length and return a void
    9·1 answer
  • Kelly is a college sophomore majoring in computer science. She is interested in gaining exposure to the most useful and current
    14·1 answer
  • Using a wireless technology known as ___, many smartphones can now be tapped on special payment devices to complete your purchas
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!