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
Gregory Yob is associated with which of these games?
DiKsa [7]

Answer:

Gregory Yob is associated with Hunt the Wumpus.

Explanation:

Hunt the Wumpus was developed in 1973 by Gregory Yob and was one of the first games where the player can move around a series of interconnected controls.

please mark brainliest it really helps :)

3 0
3 years ago
Read 2 more answers
Thomas asked his friend for a software suite. His friend had the software suite in his computer and he copied it into a small, r
Misha Larkins [42]

Answer:

The correct answer to the following question will be "Flash memory card".

Explanation:

A flash memory card seems to be a storage (small) medium which stores data or information on fordable or remote devices using non-volatile transistor technology hardware.

  • Most newer offerings include flash storage or memory chips, even though the development of other memory innovations is underway.
  • This would be the storage mechanism from which the configuration tool was replicated by Thomas' friend.
8 0
3 years ago
A table of contents does not _____ automatically [customize table of contents]
anyanavicka [17]

Answer:

update

Explanation:

a table of contents does not update itself automatically.

5 0
2 years ago
Brainliest forrrrrrr frrrrrew right herrreeee
nikdorinn [45]

Answer:

Hi!

Explanation:

Thank You So Much For The Points.

5 0
2 years ago
What computer worm was used to sabatoge iran's nuclear program?
Stels [109]
Researches at symantec have uncovered a version of the stuxnet computer virus that was used to attack irans nuclear program in November.
4 0
3 years ago
Other questions:
  • A culture that emphasizes verbal communication skills is ____________.
    9·2 answers
  • Suppose that a computer virus infects your computer and corrupts the files you were going to submit for your current homework as
    12·1 answer
  • Which file extension indicates that a file is an Adobe Acrobat document?
    13·1 answer
  • PowerPoint allows you to input files from variety of sources, such as Microsoft access.
    6·1 answer
  • What is output when the CarTest application is run? Why?
    11·1 answer
  • Which of the following is NOT contained on the Slide Show toolbar?
    11·2 answers
  • Lisa has a section of her document that she would like to include in the index. Which option should Lisa choose?
    12·1 answer
  • Can anyone help me this is due today :) <br> Thank you so much
    14·2 answers
  • Cine stie repede va rog mult si repede
    9·1 answer
  • What type of access controls allow the owner of a file to grant other users access to it using an access control list
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!