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
Mariana [72]
3 years ago
15

Write a function to calculate the distance between two points Distance( x1, y1,x2.2) For example Distance(0.0,3.0, 4.0.0.0) shou

ld return 5.0 Use the function in main to loop through reading in pairs of points until the all zeros are entered printing distance with two decimal precision for each pair of points.
For example with input
32 32 54 12
52 56 8 30
44 94 4439 6
5 19 51 91 7.5
89 34 0000
Your output would be:__________.
a. 29.73
b. 51.11
c. 55.00
d. 73.35
e. 92.66
Computers and Technology
1 answer:
Ivenika [448]3 years ago
4 0

Answer:

The function in Python3  is as follows

def Distance(x1, y1, x2, y2):

   dist = ((x1 - x2)**2 +(y1 - y2)**2)**0.5

   return dist

   

Explanation:

This defines the function

def Distance(x1, y1, x2, y2):

This calculates distance

   dist = ((x1 - x2)**2 +(y1 - y2)**2)**0.5

This returns the calculated distance to the main method

   return dist

The results of the inputs is:

32, 32, 54, 12 \to 29.73

52,56,8,30 \to 51.11

44,94,44,39\to 55.00

19,51,91,7.5 \to 84.12

89,34,00,00 \to 95.27

You might be interested in
If I want to copy a worksheet, I right-click the sheet on the bottom of the screen and click what menu item?
stellarik [79]
It depends on what application are you using
6 0
3 years ago
Lisa has a section of her document that she would like to include in the index. Which option should Lisa choose?
kupik [55]

Answer:

For including a part of the text within the index, you need to make use of the Mark Entry option. And here you can fill the required information for curating your index, you need to just follow the instruction as required, and you will be fine.

Explanation:

Please check the answer.

8 0
3 years ago
5 band resistor with two red bands, two gold bands, one purple band?
Mamont248 [21]

According to below picture, two gold bands on a 5 band resistor cannot happen. What is the order of the bands?

8 0
3 years ago
To what competitive force did the printed encyclopedia industry succumb? 1. Substitute products or services 2. Increased bargain
Nikolay [14]

Answer:

Option 1 i.e., Substitute products or services.

Explanation:

The printed encyclopedia industrial sector lost to the economic power of replacing goods or services.

In the industrial countries, the current economic situation is not feasible in terms of its consumption of products as per capita. The ' service economy ' applies not only for the tertiary sector but for an economy in which businesses generate the balance of income, and most workers are also in service operations.

7 0
4 years ago
Examine about the Internal & External Fragmentation methods give an example for each. essay​
Tju [1.3M]

Internal Fragmentation occurs when a process needs more space than the size of allotted memory block or use less space. External Fragmentation occurs when a process is removed from the main memory. Internal Fragmentation occurs when Paging is employed. External Fragmentation occurs when Segmentation is employed.

3 0
3 years ago
Other questions:
  • Define the method object inc_num_kids() for PersonInfo. inc_num_kids increments the member data num_kids.Sample output for the g
    11·1 answer
  • Driving is expensive. Write a program with a car's miles/gallon and gas dollars/gallon (both doubles) as input, and output the g
    12·2 answers
  • Where could an identity theft access your personal information
    9·2 answers
  • Suppose arraylist list1 is [1, 2, 5] and arraylist list2 is [2, 3, 6]. after list1.addall(list2), list1 is __________.
    8·1 answer
  • You can use the windows ________ to check on a nonresponsive program
    12·1 answer
  • The memory locations listed in a procedure header's parameterList have procedure scope and are removed from the computer's main
    9·1 answer
  • Write two statements to read in values for my_city followed by my_state. Do not provide a prompt. Assign log_entry with current_
    13·1 answer
  • PLEASE READ ( if you want ) Before i used to have over 30 brainliest and i was just trying to earn points so i could get to ace,
    9·1 answer
  • Consider the following code segment. int[][] arr = {{3, 2, 1}, {4, 3, 5}}; for (int row = 0; row < arr.length; row++) { for (
    6·1 answer
  • attackers typically use ack scans to get past a firewall or other filtering device. how does the process of an ack scan work to
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!