Question: Solve C++ code. See main.cpp and function.cpp. Use function.cpp to enter code (not main.cpp) main.cpp is used for reference. Using input: 0,0 10,10 Need output
6.21 HW11-01: Distance between two points Given two points (x1.yt) and (x2,y2), the distance between this points is defined as the square root of (x2-x1) 2+ (y2-y1)*2. Write a function distance(x),y1, x2, y2) that returns the distance between the given points. The main) function is written for you your job is to write the distance function Start by reviewing the code for 'main.cpp' which is visible in the editor pane-note that this code is read-only (you cannot modfy it) Notice that the main0 program inputs two points (x1.y'1) and (2 y2), calls distance to compute the distance, and then outputs this result Above the editor pane youll see the text 'Current file main.cpp, with a little drop-down arrow to the right. Click the drop-down and select functions.cpp Then, to avoid a bug in some web browsers, please immediately click the link "Load default template... You only need to do this once, the first time you view the file implement the function. To test your work in Develop mode, supply two points in the following format o,0 10,10 Each point is on a line by itself, with no spaces. in this case the output should be Distance: 14.1421 When you are ready to submit for testing, switch to Submit mode and submit for grading. You have unlimited submissions. LAB ACTTY 621.1: HW11-01: Distance between two paints 0/100 current file: functions.cpp Load default template 1 /functions.cpp 3 Rinclude clostrear 4 rinclude estrine s include comatho 7 uaing namespace std 9 double distance(int xd, int yi, int x2, int ya) i1 return 8.e Run your program as often as you'd like, before submitting for grading Below, type any needed input values in the first box, then click Run program and observe the program's output in the second box Develop mode Enter program input (optional)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
