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
Liono4ka [1.6K]
2 years ago
9

Write a class called point that represents a point in 2d plane.

Computers and Technology
1 answer:
USPshnik [31]2 years ago
7 0

In this way, writing the code in C++ we can say that it will be possible to make the coordinates on the planes.

<h3>Writing the code we have:</h3>

<em>#include <iostream></em>

<em>#include <cmath></em>

<em>#include <iomanip></em>

<em>using namespace std;</em>

<em>class Point{</em>

<em>private:</em>

<em>float x;</em>

<em>float y;</em>

<em>public:</em>

<em>Point(){ </em>

<em>x = y = 0;</em>

<em>}</em>

<em>Point(float x, float y){ </em>

<em>this->x = x;</em>

<em>this->y = y;</em>

<em>}</em>

<em>float getX(){ </em>

<em>return x;</em>

<em>}</em>

<em>float getY(){</em>

<em>return y;</em>

<em>}</em>

<em>float getDistance(){</em>

<em>return math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2));</em>

<em>}</em>

<em>string toString(){ </em>

<em>return "("(x1, y)","(x2, y2)")";</em>

<em>}</em>

<em>};</em>

See more about C code at brainly.com/question/17544466

#SPJ1

You might be interested in
Your company has purchased another company that also uses Windows Server 2016 and Active Directory. Both companies need to be ab
Scorpion4ik [409]

Answer:

Create a two-way forest trust

Explanation:

The aim here is to ensure that both companies are able to access the forest resources of each other. The creation of a Two-way Forest Trust would guarantee that as if the Two-way Forest Trust is created between Forest A and Forest B, being the forest resources of the two companies respectively, then all the domains in Forest A will trust every domain in Forest B and vice versa.

5 0
3 years ago
This operating system was used by individual computers and required users to type commands.
In-s [12.5K]

Answer:

MS-DOS is your answer

Explanation:

6 0
3 years ago
Cell division is called:
Blizzard [7]

Answer:

Mitosis

Explanation:

6 0
3 years ago
a circuit has an inductor with an inductive reactance of 230 ohms. this inductor is in series with a 500 ohm resistor. if the so
Amanda [17]

Answer: attached below

Explanation:

8 0
3 years ago
Which one bc im struggling
Setler79 [48]

Answer:

cant really see it

Explanation:

3 0
3 years ago
Other questions:
  • The Transmission Control Protocol (TCP) splits each message into multiple packets. It's possible for packets from the same messa
    10·1 answer
  • Which statements best describe slaves in ancient times? Select all that apply.
    8·1 answer
  • How does kinetic energy affect the stopping distance of a small vehicle compared to a large vehicle?
    14·2 answers
  • Just answer in five-line. Question:
    9·1 answer
  • PLEASE HELP. I’ll mark you BRAINLIST <br> Please read the comment under this question
    9·1 answer
  • What is the output of the following program? If there is any problem, how can
    13·1 answer
  • What is problem scoping
    14·1 answer
  • The function below takes two arguments: a string (name) and an integer (position). Complete the function so that it prints out t
    7·1 answer
  • write a function that given an integer n returns the smallest integer greater than n the sume of whose digits is twice as big th
    13·1 answer
  • Could anyone please answer this?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!