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
What is bug in computer?​
Anton [14]

Answer:

<h2>A bug in a computer is refered to as a "computer virus" its where certain things on the computer or apps on it aren't working like they were designed to. </h2>

Explanation:

<h2>Hope this helps:)!</h2>
6 0
3 years ago
Arrays are commonly used to store data items. Arrays can be managed in ways that fill, iterate over, add to, and delete items fr
vfiekz [6]

Answer:

mark me brainlist

Explanation:

3 0
3 years ago
Design a database suitable for a university registrar. This database should include information about students, departments, pro
zalisa [80]

Answer:

For designing a database suitable for a University registrar, the following information is included which are Information about Students, Information about Departments, Information about Professors, Information about courses, Student Grades,TA's for a course, Department offering different courses.

In creating the database registrar system the following values are defined such as Entity, Attributes of entities,The relationship among entities.

Explanation:

Solution

The following requirements are for designing of database for  a University registrar.

The Database Schema includes the following:

  • Information about Students
  • Information about Departments.
  • Information about Professors.
  • Information about courses.
  • Student Grades.
  • TA's for a course.
  • Department offering different courses.

Now,

For the design of Database for Registrar System we need to define the following:

(1)Entity: Student, Course, Instructor, Course offering.

(2) Attributes of Entities:

  • Student entity has Sid, name, program as its attributes
  • Course has Course_n, title, credits, and syllabus as its attributes
  • Instructor has iid ,name ,dept, title as its attributes
  • Course offering has section_no ,time, room, year,semester as its attributes

(3) Relationship among various entities:

  • Enrolls
  • Teaches
  • © is offered

Note: kindly find an attached copy of the E-R Diagram for University Registrar below, and his diagram shows student entity enrolls various courses which can be having teaches relationship with instructor. Course is being offered by relationship is offered by course offering.

5 0
3 years ago
Prereading strategies involve ООО introducing a text. previewing a text. summarizing a text. interpreting a text. ​
4vir4ik [10]

Answer:

A.

Explanation:

Mark Brainliest if correct!

5 0
3 years ago
How many digits are in the binary number system? Explain why.
Katen [24]

Answer:

Since there are only two digits in binary, there are only two possible outcomes of each partial multiplication: If the digit in B is 0, the partial product is also 0. If the digit in B is 1, the partial product is equal to A.

Explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • Instructions: Type the correct answer in the box. Spell the word correctly.
    5·2 answers
  • What is the purpose of the Chart feature in Word?
    10·2 answers
  • What happens when you double-click a column border??
    12·1 answer
  • Kelvin owns a small trading firm. Recently, he suspected that some of his employees were using fraudulent activities for their p
    5·2 answers
  • Implement a method called bubbleSort, that takes an ArrayList, sorts it using bubble sort algorithm, and returns a sorted list;
    14·1 answer
  • Which power backup method will continually provide power to a server if the power goes out during a thunderstorm
    11·1 answer
  • How computer viruses spread from one computer to another​
    10·1 answer
  • Which step do you think is most useful from big data life cycle and why?
    12·1 answer
  • AUPs ensure that an organization’s network and internet are not abused. Select 3 options that describe AUPs.
    12·1 answer
  • ___________________ describes the process of combining voice, video, and data communications over a common network infrastructur
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!