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
Let's revisit our lucky_number function. We want to change it, so that instead of printing the message, it returns the message.
maksim [4K]

Answer:

Replace the first blank with:

message = "Hello " + name + ". Your lucky number is " + str(number)

Replace the second blank with:

return message

Explanation:

The first blank needs to be filled with a variable; we can make use of any variable name as long as it follows the variable naming convention.

Having said that, I decided to make use of variable name "message", without the quotes

The next blank is meant to return the variable on the previous line;

Since the variable that was used is message, the next blank will be "return message", without the quotes

3 0
3 years ago
Which audio format is used to create chiptunes?
Scilla [17]
Chiptune, also known as chip music or 8-bit music, is synthesized electronic music which is made for programmable sound generator suns chops used in vintage computers,consoles , and arcade machines.
5 0
3 years ago
Read 2 more answers
Distinguish between the savings and investment options.
Tanya [424]

Answer:

Savings,                          Investments

{}Certificate of deposit    Mutual fund

{}Account                         Money Market

{}                                        Gold

Explanation:

Savings is the term used to describe the proportion of ones income not spent or kept for spending at a much later date;

Saving methods includes saving money in deposit accounts, pension savings, and cash savings as well as reducing expenditures

Savings differs from investment in the sense that investments involves more risks than savings

Mutual fund

Mutual fund is a financial resource type involving the bringing together of funds gathered from several investors for investment

Money market

The money market involves buying and selling debt investments that are short terms

Gold

Gold investment is a way of diversifying risk through futures and derivatives and futures contracts

Certificate Deposit

Certificate deposit is a fixed term deposit form of savings that provides an interest on the deposit

Account

Savings and current account are meant for saving funds

8 0
3 years ago
Complete the statement below with the correct term.
nikitadnepr [17]

Answer:

DOMAIN

Explanation:

A utility that provides names to each computer on a network is called a DOMAIN naming service.

4 0
3 years ago
Illustrate why Sally's slide meets or does not meet professional expectations?
givi [52]

The correct answer to this open question is the following.

Unfortunately, you did not provide any context or background about the situation of Sally and the problem with her slides. We do not know it, just you.

However, trying to be of help, we can comment on the following general terms.

When someone does not meet professional expectations, this means that this individual did not prepare her presentation, lacked technical skills, did not included proper sources, or missed the proper visual aids to make the presentation more attractive and dynamic.

What Sally can improve about her slides is the following.

She can design a better structure for the presentation to have more congruence.

Sally has to clearly establish the goal or goals for her presentation.

She has to add many visuals instead of plain text. This way she can better capture the interest of her audience.

If she can use more vivid colors instead of pale or dark ones, that would be best.

No paragraphs unless necessary. She better uses bullet points.

Take care of the tone of her voice. During her practice, she can record her vice to check how it sounds.

5 0
2 years ago
Other questions:
  • John works for Internal Computer Specialists, which focuses on helping small business owners resolve MIS infrastructure issues.
    12·1 answer
  • Which of the following best describes the protocols used on the Internet?
    7·1 answer
  • To create a cover letter to send to potential employers along with a resume, what software program should you use ?
    6·2 answers
  • Your organization's network has multiple layers of security devices. When you attempt to connect to a service on the Internet. H
    9·1 answer
  • The hexadecimal number system uses alphabets A to F to represent values_ to _
    12·2 answers
  • In 1971, Intel created and marketed the first microprocessor chip, called the Intel 4004. What was significant about this invent
    7·1 answer
  • List some of the ways that healthcare information technology is making healthcare more of a self-service industry?
    11·1 answer
  • Which line of code outputs the decimal portion of a float stored in the variable x? print (x % 1000) print (x) O print (x / 1000
    13·1 answer
  • I need help ASAP 66 points this is a lab in Testout For Microsoft access I have been at this for about an hour
    10·1 answer
  • If consumers start to believe they need a product, what is likely to happen
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!