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
File-sharing programs such as Napster, Kazaa, and iMesh make it possible for individuals to exchange music files over the Intern
Mashutka [201]

Answer:

Option A) Demand for CDs has decreased, causing equilibrium price and quantity to decrease.

is the correct answer.

Explanation:

  • File-sharing is a common practice nowadays. It helps us by providing access to different files (audio , video, images, documents) to others in a faster way.
  • A wide range of files are shared daily by using different means of file-sharing including computer networks and peer-to-peer networking.
  • Formerly, the data was shared using CDs but now this system has been replaced with the advent of internet.
  • Usage of CDs is dropped drastically and hence their demand is decreased.
  • So now the prices of CDs are not in equilibrium and their quantity is also decreased.

i hope it will help you!

3 0
3 years ago
23. What is the value of 3 - (4 + 2 *3)/(8-2) + 7 * 2+4
Artist 52 [7]

Answer:

30 djjjjj*fjfktdyldydxpitdotdtiotdtod

8 0
3 years ago
You have a manager who makes decisions without getting input from anyone. They are unwilling to change anything once a decision
saw5 [17]

Answer:

autocratic

Explanation:

taking no account of other peoples wishes or opinions; domineering

3 0
2 years ago
Core to resource management system is the _________that coordinates the server hardware.
vichka [17]
Hehdhdjdjddjdjid iridium chi jo j o j o j o j
5 0
2 years ago
Omar wants to add transitions to his presentation, so he clicks the Transitions tab. Which tasks can he now complete? Check all
ser-zykov [4K]

Answer:

a b c and d

Explanation:

edgunity 2020

7 0
3 years ago
Other questions:
  • Piers wants to take a course on XML. He is a certified web designer, but he has not used XML before. How can he use XML to impro
    6·1 answer
  • What answer best explains why improper netiquette is considered dangerous? Individuals who violate user policies are often charg
    14·2 answers
  • What can search the internet and select elements based on important words
    10·1 answer
  • Analyze the following code: class Test { public static void main(String[] args) { System.out.println(xMethod((double)5)); } publ
    7·1 answer
  • Which of the following lists the proper order of the categories of the SOC system from general to specific?
    11·1 answer
  • Define the instance method inc_num_kids() for PersonInfo. inc_num_kids increments the member data num_kids. Sample output for th
    6·1 answer
  • What are 3 software programs for mobile computing?
    10·1 answer
  • For 8.6 code practice: Question 1 It keeps says it's an infinite loop and it will not work can someone give me the code that wil
    9·1 answer
  • An epic games service is unavailable at the moment
    8·1 answer
  • WILL GIVE BRAINLIEST!!! PLEASE HELP!!!
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!