Write a class called point that represents a point in 2d plane.
- the constructor accepts the x and y dimensions of the point.
- provide a method getx that returns the x coordinate of a point, and another method gety
that returns the y coordinate of a point.
- provide a method called translate that changes the original coordinates of the point by
adding a given values for x and y coordinates.
- provide a method distanceto that calculates the distance between that point and another
one.
use this equation to calculate the distance math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2))
while the math is a library you should import. where the (x1, y) is the coordinates of the first point
and (x2, y2) is the coordinates of the second point
the output should be like this screenshot

Answers

Answer 1

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

Writing the code we have:

#include <iostream>

#include <cmath>

#include <iomanip>

using namespace std;

class Point{

private:

float x;

float y;

public:

Point(){

x = y = 0;

}

Point(float x, float y){

this->x = x;

this->y = y;

}

float getX(){

return x;

}

float getY(){

return y;

}

float getDistance(){

return math.sqrt((x2 - x1) ** 2 + (y2 - y1) ** 2));

}

string toString(){

return "("(x1, y)","(x2, y2)")";

}

};

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

#SPJ1

Write A Class Called Point That Represents A Point In 2d Plane. - The Constructor Accepts The X And Y

Related Questions

Complete the following sentences using each of the words provided ONCE only. KEYBOARD DESKTOP STORE PRINTER COMPUTER MOUSE MONITOR CD Bay PRINTER TOWER CASE CENTRAL PROCESSINGENIT is an electronic device that retrieves, and processes shows you what is going on in the computer. is the first image you see on your screen when the computer is is used for telling the computer what to do. is used for typing documents. is used for putting documents on paper. you can insert a CD or Compact Disc. is is box inside and shaped 1) A 2) The 3) The data. switched on. 4) The 5) The 6) The 7) In the 8) The it​

Answers

Answer:

Explanation:

Monitor is an electronic device that retrieves, and processes shows you what is going on in the computer.

Desktop is the first image you see on your screen when the computer is is used for telling the computer what to do.

keyboard

is used for typing documents. Printer is used for putting documents on paper. CD Bay you can insert a CD or Compact Disc. is is box inside and shaped

Write a Java expression that converts the value of 'y' into an integer, and assigns the value to 'x'.

Answers

[tex]\huge{\purple{\underline{\underline{\mathfrak{\red{\bigstar answer:: \bigstar}}}}}}[/tex]

int y = (int) y;

int x = y;

Hope it helps..♪

When an attacker has access to a password file, they can run a password-cracking program that uses a dictionary of known words or passwords as an input file. What type of attack is this attacker performing

Answers

The type of attack that the attacker is performing is a dictionary attack.

What is a dictionary attack?

A dictionary attack is a way of breaking right into a password-protected computer, community, or different IT useful resource with the aid of using systematically coming into each phrase in a dictionary as a password.

A dictionary attack also can be utilized an try to discover the important thing vital to decrypt an encrypted message or document.

The missing information in the question:

ciphertext-only

brute force

dictionary

replay

Therefore, The type of attack that the attacker is performing is a dictionary attack.

Learn more about dictionary attack:

https://brainly.com/question/14728015

#SPJ1

Which of the following choices is evidence that present-day vertebrates shared common ancestors?
They all have hearts and feet.

They display similar embryo development and share common genes that control development.

They have many bone structures that are unique to each species.

They all thrive in a single
ecosystem.

Answers

Answer:

B/Second

Explanation:

They display similar embryo development and share common genes that control development.

When staff member is resistant to change, but is open to factual information to support the need for change, what type of behavioral change strategy should the manager use to implement change

Answers

The type of behavioral change strategy that the manager can use to implement change is Positive reinforcement.

What is Positive reinforcement?

This is known to be the introduction of a good or pleasant stimulus after a behavior is said to be displayed.

Note that The type of behavioral change strategy that the manager can use to implement change is Positive reinforcement as desirable stimulus empowers the behavior, making it more likely to occur.

Learn more about Positive reinforcement from

https://brainly.com/question/8517742

#SPJ4

Write a recursive, string-valued method, reverse, that accepts a string and returns a new string consisting of the original string in reverse. For example, calling reverse with the string goodbye returns the string eybdoog.Reversing a string involves:

Answers

The program is an illustration of recursive functions in Python;

Recursive functions are functions executed from within itself

The python program

The program written in python, where comments are used to explain each action is as follows:

#This defines the function

def revStr(myStr):

   #This returns an empty string if the string is empty

   if myStr == "":

       return myStr

   #If otherwise, this returns the reversed string recursively

   else:

       return revStr(myStr[1:]) + myStr[0]

Read more about python recursions at:

https://brainly.com/question/19089783

#SPJ1

Summary on how drones can help manage the environment

Answers

Answer:

Well, I do know that they can help water plants they can also use sprays and other things that help the environment.

Explanation:

I learned this in my PLTW.

The destination transmission control protocol (TCP) process has set a 1,000-byte receive buffer window. The source TCP sequence number starts at 23,100 and sends the following segments, in order: Segment 1-200 bytes; Segment 2-300 bytes; Segment 3-200 bytes; and Segment 4-300 bytes. The last acknowledgment the source received was sequence number 23,600 saying the receive buffer can now hold 800-300 byte streams. The retransmission timer for sequence number 23,600 has expired, so what will the source TCP do next

Answers

Because the retransmission timer for sequence number 23,600 has expired, the source TCP will trigger a process that resends segments 3 and 4.

What is TCP/IP?

A term in Computer Networking Protocol, it stands for Transmission Control Protocol/Internet Protocol.

It serves the function of indicating how data is transported over the internet by ensuring that there is communication from end to end.

This end-to-end communication process is able to spot how such data can be sectionalized into packets, addressed, routed, transmitted and how it is received when it gets to the terminal point.

Learn more about TCP at:
https://brainly.com/question/17387945
#SPJ1

Consider the following method: public int mystery(int n) { if(n > 6) { return 1 mystery(n - 1); } return n % 3; } What is the value of mystery(10)

Answers

Answer:

Ans1--- The output is 9 Explanation--- mystery(5)=mystery(4)+2 mystery(4)=mystery(3)+2 mystery(3)=mystery(2)+2 mystery(2)=2+1=3

What are three key components of effective computer games?
A. An obstacle or enemy that makes the game challenging
B. A continuously updating point score
C. A set of rules that is fair and transparent
D. A goal that you must reach or achieve to "win"
SUBMIT

Answers

The key components of effective computer games are:

An obstacle or enemy that makes the game challenging A set of rules that is fair and transparent. A goal that you must reach or achieve to "win"

What is computer game?

A computer games is known to be a game that a person often plays through the use of a computer and it is called a video game.

Note therefore, that The key components of effective computer games are:

An obstacle or enemy that makes the game challenging A set of rules that is fair and transparent. A goal that you must reach or achieve to "win"

Learn more about computer games  from

https://brainly.com/question/16104941

#SPJ1

What type of websites, which let users share personal stories and photos, became popular in the 2000s?.

Answers

Answer:

MMORPGS was a type of website that let users share their stories and pics across the world wide web

Explanation:

Which option identifies the programming paradigm selected in thr following scenario? A student is writing a science fiction story that deals with artificial intelligence. He wants to be realistic. He decides to add computer terms to the story that pertain to his storyline.

A. Java
B. Python
C. Perl
D. Ruby

Answers

Answer:

java

Explanation:

Java es rápido, seguro y fiable. Desde ordenadores portátiles hasta centros de datos, desde consolas para juegos hasta computadoras avanzadas, desde teléfonos móviles hasta Internet, Java está en todas partes. Si es ejecutado en una plataforma no tiene que ser recompilado para correr en otra. Java es, a partir de 2012, uno de los lenguajes de programación más populares en uso, particularmente para aplicaciones de cliente-servidor de web

3. What of the following is the main components of computer system?
a. CPU, Input unit, Output Unit, Memory Unit
b. CPU, Memory, System bus, Input, Output, Pen drive
c. Modem, Keyboard, Word Processor, Printer, Screen
d. Memory, Video Card, Monitor, Software, Hardware.

Answers

Answer:

CPU, input unit, Output unit, memory unit

It’s A. CPU, input unit, output unit, memory unit.

Where should the VPN concentrator be installed?

On the cloud
Outside of the network
On the network edge using a firewall
On the network edge without a firewall

Answers

c, using a firewall make sures no viruses enter your device while setting up the vpn

Answer:

or this?

Explanation:

the vpn is this it?

Write a program that draws an 8 8 chess board, with alternating gray and white squares. You can use the SetTextColor and Gotoxy procedures from the Irvine32 library

Answers

Using the knowledge in computational language in C code it is possible to write a customized chess code.

Writting the C code as:

Wait      PROTO

Write     PROTO

CrLf          PROTO

Delay         PROTO

Clrscr        PROTO

PROTO times:byte, color:dword

PROTO times:byte, color:dword

ROTO color:dword

PROTO color:dword

UpdateColor   PROTO

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

#SPJ1

Pls help me po:{

I need the answer lang po talaga , pls:{

Answers

Answer:

for cutting it's scissors for measuring it's the tiny measurement spoonlikes for mixing it's the blender and preparatory

how does a paper prototype minimize constraints when compared to a digital one

Answers

A regular prototype minimizes constraints if compared to a paper one because possible problems in use can be identified easily.

What is a prototype?

This refers to the initial model of a product designed to test the features of the model before it is released to the market.

What are the differences between digital and paper prototypes?

Online protoypes are often time-saving, however, because some features of the prototype cannot be tested, a regular protoype is much better to identify possible problems in design or use.

Learn more about prototipes in: brainly.com/question/4622383

#SPJ1

What will be the output, if any, when the user clicks the right mouse button?

from tkinter import
def clicked(event):
print("That hurt.")
widget = Button(None, text='Button')
widget.pack()
widget.bind('', clicked)
widget.mainloop()

O an error statement
O That hurt.
O no output
O Button

Answers

The output, if any, when the user clicks the right mouse button is (b) That hurt

How to determine the output?

The flow of the program implies that:

When the user clicks the button, the program prints "That hurt" without the quotes.

This action is on the third line of the program

Hence, the output, if any, when the user clicks the right mouse button is (b) That hurt

Read more about programs at:

https://brainly.com/question/16397886

#SPJ1

To write, test and run your JavaScript code, you need ..................

Answers

ANSWER:

To write a JavaScript code, you need a web browser and either a text editor or an HTML editor.

There are numerous strict and steadfast rules when it comes to composition.

answers:
true
false

Answers

Answer:

false

Explanation:

none ¯\_(ツ)_/¯

Please help quick!! 20 points

a table is a ___ of rows and columns that provides a structure for presenting data.

Answers

Answer:

vertical and horizontal

Human interest stories usually focus on:

OA. celebrities and politicians.

OB. a worldwide catastrophic event.

OC. animals in danger.

D. people's triumphs and struggles.

Answers

The human interest stories are found to be made focused on the people's triumphs and struggles. Thus, option D is correct.

What are stories?

Stories are the given as the part of the narrative tale comprising the events and the experiences presented with the sequence of words. The  stories can be fictional and nonfictional.

The humans found the stories that are related to the struggles and have the connections with the people's triumphs to be more focused. Thus, option D is correct.

Learn more about the stories, here:

https://brainly.com/question/11300469

#SPJ1                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      

Assume x represents an integer number, what is the highest index value in the following array? byte[] values = new byte[x]; Group of answer choices

Answers

Answer:

You forgot to add a group of choices, however assuming this programming language uses 0-based indexes the answer would be x - 1

Explanation:

Zero based index languages have array indexes starting at 0. When you create that array, you use x to define the amount of elements, however due to the array starting at the index 0, the arrays highest index would be x - 1 instead of x.

Color, font, and images are all important aspects of good ________.
A. contrast
B. coordination
C. design
D. planning

Answers

Color, font, and images are all important aspects of good  design. Check more about design below.

What is the Principles of Design?

A Good design is one that has to have a good understanding of how design works.

Note that the color, contrast and others are very important part of creating good designs and as such, Color, font, and images are all important aspects of good  design.

Learn more about Color from

https://brainly.com/question/911645

#SPJ1

Susan discovers the following log entries that occurred within seconds of each other in her Squert (a Sguil web interface) console. What have her network sensors most likely detected

Answers

Based on the above, A port scan have her network sensors most likely detected.

What is this case about?

As a result of the different of connection made as shown, it is most likely due to port scan because the numbers of failed connections to a lot of services within a few seconds is similar for a port scan attempt.

Therefore, Based on the above, A port scan have her network sensors most likely detected.

See options below

A failed database connection from a server

A denial-of-service attack

A port scan

A misconfigured log source

Learn more about network sensors  from

https://brainly.com/question/13437049

#SPJ1

If you accidently looked up a link, and the same link keeps popping up everywhere, how do you stop it? On a phone.​

Answers

Answer:

u go to your settings and stop notification

Answer:

On your Android phone or tablet, open the Chrome app Chrome · Go to a webpage. · To the right of the address bar, tap More More and then · Tap Site settings.

2
select the correct answer.
which part connects the cpu to the other internal parts of a computer?
o a.
alu
ob.
bus
o c.
control unit
od.
memory unit
oe.
register

Answers

Answer:

the control center

Explanation:

hope this helps :)

please make me brainliest\


Which statement best describes one reason why assembly language is easier
to use than machine language?

Answers

Answer:

machine language uses binary code and assembly language uses mnemonic codes to write a program.

Explanation:

In a nutshell, machine language uses binary code, which is almost impossible for humans to decipher, whereas assembly language uses mnemonic codes to write a program. Mnemonic codes make it simpler for humans to understand or remember something, and so make the language a bit easier for humans to use than machine code.


in which part of the scratch interface does a programmer combine code blocks to build the program?

a. sprite info pane
b. block palette
c. stage
d. scripts area

Answers

Answer:

D

Explanation:

The sprite info pane is for an overview over your sprites and their visibility, coordinates, etc.

The block palette is where you select blocks from.

The stage is where your figures move and do stuff.

The scripts area is where you combine blocks from the palette together.

Def transfer(bank, log_in, usera, userb, amount): ''' in this function, you will try to make a transfer between two user accounts. bank is a dictionary where the key is the username and the value is the user's account balance. log_in is a dictionary where the key is the username and the value is the user's log-in status. amount is the amount to be transferred between user accounts (usera and userb). amount is always positive. what you will do: - deduct the given amount from usera and add it to userb, which makes a transfer. - you should consider some following cases: - usera must be in the bank and his/her log-in status in log_in must be true. - userb must be in log_in, regardless of log-in status. userb can be absent in the bank. - no user can have a negative amount in their account. he/she must have a positive or zero balance. return true if a transfer is made. for example:

Answers

Using the knowledge in computational language in python this code will be described for bank is a dictionary where the key is the username and the value is the user's account balance.

Writing code in python:

def transfer (bank, log_in, userA, userB, amount):

if userA in bank and log_in[userA]:

 if userB in log_in:

   if amount <= bank [userA]:

     bank [userA] -= amount

     bank[userB] += amount

     return true

 return false

 bank= {"Bradon": 115.5, "Patrick": 18.9, "Sarah": 827.43, "Jack": 45.0, "James": 128.87}

 log_in= {"Bradon": False, "Jack": False, "James": False, "Sarah": False}

 transfer(bank, log_in, "Bradon", "Jack", 100)

See more about python at brainly.com/question/18502436

#SPJ1

Other Questions
write an article for publication in one of the national newspaper on the topic:. the usefulness of the mobile phone Sasha is playing a game where she tosses a coin, then rolls a die. She wins if she gets heads on the coin and a 5 on the die. What is the probability she wins?A) `1/3`,`P(H and 5) = P(H) - P(5) = 1/2-1/6=3/6-1/6=2/6` or `1/3`. That makes sense since tossing a coin and rolling a die are independent events.B) `2/3`,`P(H and 5) = P(H) + P(5) = 1/2+1/6=3/6+1/6=4/6` or `2/3`.That makes sense since tossing a coin and rolling a die are independent events. C) `1/12`. That makes sense since tossing a coin and rolling a die are independent events. `P(H and 5) = P(H) P(5) = 1/2 1/6=1/12`D) `12/12` or `1`. That makes sense, because she should win every time she plays. A man pushes a shopping cart full of groceries at a constant velocity. What happens if the man DECREASES the force of his push on the cart? A. The cart slows down. B. The cart speeds up. C. The cart moves at the same speed. D. The cart becomes less massive. _____is an acute response to stress that can occur prior to the fight-or-flight response. a. Adapt-or-acquiesce b. Freezing c. Help-or-hinder d. Stop-and-go e. Tend-and-befriend n = ut - gt2 Find h when u = 100t=1% & g=6.4 The diameter of a semicircle is 8 millimetres. What is the semicircle's radius? You are on a boat in the middle of the Pacific Ocean at the equator traveling in a hydrofoil going at a constant speed of 300 /. The water is perfectly still. What is your acceleration: a) If youre heading due North? b) If youre heading due East? c) If youre heading straight up (something probably went wrong at this point). You may assume the following: The earth has a radius of 6371 km. The earth makes one full revolution every 24 hours. The gravitational constant at sea level is 9.81 m/s2 East and North are relative to the Earths axial north, not magnetic north. Would it be possible to make VR technology in a way that our brain sees imagined experiences using simple impulses (like words) sent to the brain? Within the visible spectrum, our experience of red is associated with ________ waves of light. Is this phrase important today? Why or why not?Insure domestic tranquility. Match the vocabulary words to the correct definitions. Drag the vocabulary words on the right-hand side of the screen to the definitions with which they match.A test or activity that measures a persons current fitness for one task with specific protocols. A result that can be achieved in 2-4 weeks. A plan for improvement. A result that can be achieved in 2 months or more. A result towards which effort is made for maintenance or improvement. A process used to set goals that are specific, measurable, attainable, realistic and time-bound. AnswersFitness ChallengeGoal SettingS.M.A.R.T. Goals Setting StrategyLong-term GoalShort-term GoalGoal Help with this inequality pleaze which ordered pair could represent a y-intercept on a graph The circle is centered on point p. points j, k and l lie on the circumference. zjlk measures 47. find the measure of zjpk. a pool ball is rolling along a table3 with a constant velocity. the components of its velocity vector are Vx=0.5 m/s and Vy=0.8 m/s. Calculate the distance it travels in 0.4 s Megan is interested in studying how the environment may modify behavior. Megan is most likely interested in the study of _____ psychology. Please choose the correct answer from the following choices, and then select the submit answer button. behavioral A winery has a vat with two pipes leading to it. The inlet pipe can fill the vat in 3 hours, while the outlet pipe can empty it in 10 hours. How long will it take to fill the vat if both pipes are left open? The religious orders that sought a balance between the Cluny reform and the Rule of St. Benedict were known as: Group of answer choices Benedictines Dominicans Cistercians Franciscans Porter's coat has a diameter of 8 millimeters. What is the button's area Accuracy is a measure of how close an answer is to actual or expected value true or false