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
Assoli18 [71]
3 years ago
13

Write a program that reads from the user any three points in two dimensional space: x1, y1, x2, y2, x3, y3. Assume these points

form a line segment, (x1, y1) to (x2, y2) to (x3, y3). Calculate the sum of these line segments and print value to two decimal places.For example with points (0.0, 0.0), (3.0, 4.0), (6.0, 8.0), the distance for the first segment is 5.0, the second segment is 5.0, so the output for this case would be 10.00. The input and output for this case would be:INPUT:0.0 0.03.0 4.06.0 8.0OUTPUT: 10.00
Computers and Technology
1 answer:
netineya [11]3 years ago
6 0

Answer:

The solution code is written in Python:

  1. import math  
  2. coord= input("Enter coordinates for three points: ")
  3. coordList = coord.split(" ")
  4. for i in range(0, len(coordList)):
  5.    coordList[i] = float(coordList[i])
  6. seg_1 = math.sqrt((coordList[0] - coordList[2])**2 + (coordList[1]- coordList[3])**2)
  7. seg_2 = math.sqrt((coordList[2] - coordList[4])**2 + (coordList[3]- coordList[5])**2)
  8. print(seg_1 + seg_2)

Explanation:

Firstly, we can use Python built-in method <em>input()</em> to get coordinates for three points from user (Line 3). To simplify the entry process, the input of the three coordinates is expected in a single string 0.0 0.0 3.0 4.0 6.0 8.0O. Please note each of the coordinates is separated by a single space.

Next, we can proceed to use Python string split() method and single space character " " as separator to break the input string of coordinates into a list of individual numbers ["0.0", "0.0", "3.0", "4.0", "6.0", "8.0"].

Prior to calculating the line segment, it is important to ensure the coordinates in the list,<em> coordList</em>, have been converted from string to float type (Line 6 - 7).

Next, we are ready to apply the Distance formula to calculate the length of the two line segments that join the three coordinates (Line 9 and Line 11).  The distance formula is \sqrt{ (x1 - x2){^2}  +  (y1 - y2){^2}   }

At last, sum up the two line segments, <em>seg_1 </em>& <em>seg_2 </em>and print it in the terminal (Line 13).

You might be interested in
An IT systems engineer creates a new Domain Name System (DNS) zone that contains pointer (PTR) resource records. Which zone type
faust18 [17]

Answer:

SOA

Explanation:

Statement of Authority, or you could also say that the zone that has been created is a reverse lookup

4 0
3 years ago
The answer is family and friends
nadya68 [22]
Family and Friends



you said the answer was that, soooooo
5 0
3 years ago
Read 2 more answers
You share a number of files from your computer, and you've received a number of calls from users who say they can't connect to t
zmey [24]

Answer:

ifconfig p2s1 down ifdown enp2s1 ip link set enp2s1 down

Explanation:

It can be used to enable or disable a network port interface in Linux. It involves 5 methods which are.

A.) ifconfig command. Is adopted in configuring a network interface, it gives info about NIC

B.) ifdown/if up command. Used to bring down or bring up a network interface.

C.) ip command. Used in managing NIC

D.) nmc1i command

It is a line tool that controls network manager and is also used in describing the status of a network.

E.) nmtui command

4 0
3 years ago
The university student registration system is unable to cope with the high volume of telephone calls received at registration ti
Y_Kistochka [10]

The university student registration system is unable to cope with the high volume of telephone calls received at registration time. Among others, busy signals and long distance charges are inherent problems of the telephone registration system.

An online student registration system needs to be developed. In addition, students on campus, off campus, in-state, out of state, and out of country can easily and inexpensively take advantage of many of the services provided by the Office of the Registrar, which today require users to be on campus during business hours.

What is System investigation

System Investigation is the process of finding out what the system is being built to do and if the system is feasible. I

t is the process of finding out what the system is being built to do and if the system is feasible. This will help gain an understanding of the technical resources of the organization and their applicability to the needs of the system.

System Analysis and Design - Overview:

Systems Analysis:

It is a procedure for gathering and analyzing data, determining the issues, and breaking down a system into its constituent parts.

System analysis is done to investigate a system or its components in order to pinpoint its goals. It is a technique for solving problems that makes the system better and makes sure that all of its parts function effectively to serve their intended purposes.

Analysis lays out the system's proper course of action.

Systems Design:

Planning a new business system or replacing an existing system involves defining its modules or components to meet the necessary requirements. Prior to making any plans, it is essential to have a thorough understanding of the current setup and decide how to make the most effective use of computers.

To know more about System investigation, visit: brainly.com/question/14682150

#SPJ9

4 0
1 year ago
Select the correct answer.
Naya [18.7K]

Answer:

The correct answer is: Option OD: function

Explanation:

Many programming languages use functions to make the coding simple and easy to understand. A function is like a small unit that takes input in the form of arguments or parameters, does the processing on the input and returns the output.

Hence,

The correct answer is: Option OD: function

6 0
3 years ago
Other questions:
  • What is the best approach to handling the expectation of privacy by employees in the event an investigation needs to be carried
    15·1 answer
  • The part of the computer that contains the brain or central processing unit is also know as the
    15·2 answers
  • A network host with an IP address of 192.168.10.200 wants to send a message to a destination computer with an assigned IP addres
    6·1 answer
  • How can an individual find career data?
    13·1 answer
  • Alan is the security manager for a mid-sized business. The company has suffered several serious data losses when mobile devices
    9·1 answer
  • A deleted file or folder is not permanently deleted from a computer until which event occurs?
    5·1 answer
  • #It helps in the proper function ing of computer hardware.
    14·1 answer
  • 5. Compare the telephone network and the internet. What are the similarities? What are the differences?
    12·1 answer
  • NEED HELP ASAP
    13·2 answers
  • What variation pairs a new employee with an employee who has been with the company for 20 years?
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!