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
LekaFEV [45]
2 years ago
11

Define a function CoordTransform() that transforms the function's first two input parameters xVal and yVal into two output param

eters xValNew and yValNew. The function returns void. The transformation is new
Computers and Technology
1 answer:
Butoxors [25]2 years ago
4 0

Complete Question:

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.

Answer:

The function written in C++ is as follows:

void CoordTransform(int xVal, int yVal) {

   int xValNew = (xVal + 1) * 2;

   int yValNew = (yVal + 1) * 2;

   cout<<"New x: "<<xValNew<<endl;

   cout<<"New y: "<<yValNew;

}

Explanation:

This line defines the function

void CoordTransform(int xVal, int yVal) {

This line declares and calculates xValNew

   int xValNew = (xVal + 1) * 2;

This line declares and calculates yValNew

   int yValNew = (yVal + 1) * 2;

This line prints xValNew

   cout<<"New x: "<<xValNew<<endl;

This line prints yValNew

   cout<<"New y: "<<yValNew;

}

<em>See attachment for complete program that includes the main method</em>

Download cpp
You might be interested in
A _______________ is a particular type of network that uses circuits that run over the Internet but that appears to the user to
ArbitrLikvidat [17]

Answer:

A virtual privte network is a particular type of network that uses circuits that run over the Internet but that appears to the user to be a private network.

5 0
2 years ago
The following code is intended to test whether the int variable num is less than 10, and if so print a warning and set it to 10.
hoa [83]

The only correction I see is you need to add curly braces to enclose the second and third lines.

6 0
3 years ago
Preciso de ajudar para resolver esse exercício, é para amanhã cedo!!<br><br> Em Dev C++
LenKa [72]
Bbbbbbbbbbbbbbbbbbbbbb
3 0
3 years ago
Read 2 more answers
The Polish mathematician Wacław Sierpiński described the pattern in 1915, but it has appeared in Italian art since the 13th cent
soldi70 [24.7K]

Answer:

/ Sierpinski.java

public class Sierpinski {

     // method to find the height of an equilateral triangle with side length =

     // length

     public static double height(double length) {

           // formula= length*sqrt(3)/2

           double h = (length * Math.sqrt(3)) / 2.0;

           return h;

     }

     // method to draw a filled triangle (pointed downwards) with bottom vertex

     // x,y

     public static void filledTriangle(double x, double y, double length) {

           // finding height

           double h = height(length);

           // filling triangle as a polygon

           // passing x, x-length/2, x+length/2 as x coordinates

           // and y, y+h, y+h as y coordinates

           StdDraw.filledPolygon(new double[] { x, x - (length / 2.0),

                       x + (length / 2.0) }, new double[] { y, y + h, y + h });

     }

     // method to draw an n level sierpinski triangle

     public static void sierpinski(int n, double x, double y, double length) {

           // checking if n is above 0 (base condition)

           if (n > 0) {

                 // drawing a filled triangle with x, y as bottom coordinate, length

                 // as side length

                 filledTriangle(x, y, length);

                 // drawing the triangle(s) on the top

                 sierpinski(n - 1, x, y + height(length), length / 2);

                 // drawing the triangle(s) on the left side

                 sierpinski(n - 1, x - (length / 2.0), y, length / 2);

                 // drawing the triangle(s) on the right side

                 sierpinski(n - 1, x + (length / 2.0), y, length / 2);

           }

     }

     public static void main(String[] args) {

           // parsing first command line argument as integer, if you dont provide

           // the value while running the program, this program will cause

           // exception.

           int n = Integer.parseInt(args[0]);

           // length of the outline triangle

           double length = 1;

           // finding height

           double h = height(length);

           // drawing a triangle (pointed upwards) to represent the outline.

           StdDraw.polygon(new double[] { 0, length / 2, length }, new double[] {

                       0, h, 0 });

           // drawing n level sierpinski triangle(s) with length / 2, 0 as x,y

           // coordinates and length / 2 as initial side length

           sierpinski(n, length / 2, 0, length / 2);

     }

}

7 0
3 years ago
What type of network access control uses Active Directory to scan a device to verify that it is in compliance?
Komok [63]

Answer:

Agentless NAC

Explanation:

An active directory is a kind of storage service that holds data of objects like user credentials, resource location etc, for permission and network access authentication.

Network access control is a form of computer network security that integrates security technology like antivirus, intrusion detection and prevention systems etc to system authorisation and authentication processes to control access to a network.

An agentless network access control uses the active directory to scan devices to confirm its compliance to security policies.

3 0
3 years ago
Other questions:
  • a computer that no longer works after having minor repair work done to it may have been damaged by ______.
    6·1 answer
  • In mathematics, the factorial of a positive integer n, denoted as n! , is the product of all positive integers less than or equa
    10·2 answers
  • The need to strike a<br>- among work, life, family, and other responsibilities is<br>universal.​
    15·1 answer
  • Solve a single producer, single consumer problem using wait() and notifyAll(). The producer must not overflow the shared buffer,
    5·1 answer
  • ____ technology is the same as that used in digital watches, or the time display on a microwave oven
    14·1 answer
  • What are the classifications of computer
    9·1 answer
  • You are implementing a new application control solution. Prior to enforcing your application whitelist, you want to monitor user
    5·1 answer
  • What is a Computer ?and it's demerits​
    13·2 answers
  • Write a C function named apply_all that expects two arrays of integers and their sizes and dynamically allocates a new array of
    7·1 answer
  • Describe comm<br>unication cycle​
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!