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]
3 years ago
9

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

Computers and Technology
1 answer:
USPshnik [31]3 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
Which of these is an application to control
N76 [4]

Not sure if your asking what certain application or the definition. But the definition: A security practice that blocks or restricts unauthorized applications from executing in ways that put data at risk.

6 0
3 years ago
As computers become faster, memory access speeds are not keeping pace. Question 5 options: True False
oee [108]

Answer:

True

Explanation:

As computers become faster, memory access speed have not been keeping pace. In 1999, processor speeds went up from 90MHz to 500MHz, but during this same period, memory access have only gone from 120ns to 50ns. This shows that in this period, processor speed grew more than five times its value, but memory grew only 2.5 times its value.

8 0
4 years ago
Question 1<br> a node is.<br> •a sever<br> A Cell Phone<br> A Laptop<br> a device on a network
RSB [31]

Answer:

From Networkopoint of view, a node is a redistribution point or communication point or a connection point.

It can also mean devices or data points on a large network Such as laptop, phones, printers, etc

Explanation:

3 0
4 years ago
What are the origins of the parking barrier?
Volgvan
Is there a photo we can see?
8 0
3 years ago
What is the processing speed for the second generation of computers​
natima [27]

Answer:

10mbps

Explanation:

that's what the internet says

5 0
3 years ago
Other questions:
  • Do you think engineers have to adapt their original plans during the construction of systems or products? Why might they?
    6·1 answer
  • o maintain reasonable key security (mark all that apply): Ensure that someone else always has an extra key. Ensure that no extra
    10·1 answer
  • A new company will have 40 workstations in one building sharing a single network. All users must be able to share files and prin
    9·1 answer
  • Which of the following are provided by most
    5·1 answer
  • What does anyone who chooses to use speech recognition software need to do? Create a Guest Account.
    8·1 answer
  • What type of filtering software divides email messages that have been received into two piles, spam and non-spam and then analyz
    13·1 answer
  • Cuales son mis fortalezas como estudiantes
    14·1 answer
  • Columns, margins and orientation can all be found on what tab?
    15·1 answer
  • If background option when creating file. the color of the background is
    10·2 answers
  • How do i stop my computer from automatically connecting to a wireless network
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!