subject
Engineering, 05.05.2020 08:56 izabelllreyes

In this exercise, you will write a Point structure that represents a space in two-dimensional space. This Point should have both x and y elds (please use these exact names). You will also write three functions for dealing with Points; freadPoint, manhattanDistance, and euclideanDistance. freadPoint should take in a FILE handle and a Point (by reference) that it will initialize; it should not do any prompting. It will return true if it succeeds in reading a point and false if it fails. Each point will be a line in the le, with the x and y coordinates separated by spaces. A sample input le, point29.txt has been included. The manhattanDistance function will take two Points and compute the Manhattan distance (city block distance) between them, which is the distance that you would travel if you are restricted to walking parallel to either the x or y axes. Likewise, the euclideanDistance function will take two Points and compute the Euclidean distance (straight-line distance) between them. Neither function prints anything; they simply return a value. Your main function will prompt the user to enter two points and then display the Manhattan and Euclidean distances. You should call each of your functions (using stdio as a parameter to freadPoint) to do so. You may want to use the fabs and sqrt functions to help you with this assignment

ansver
Answers: 1

Another question on Engineering

question
Engineering, 04.07.2019 18:10
The flow rate of air through a through a pipe is 0.02 m5/s. a pitot static tube is placed in the flow. the radius of the pitot static tube is 1 mm. assuming the flow to be steady and the air to be at 300k, calculate the difference in total and static pressure if the diameter of the pipe is: (a) d 0.1 m d 0.05 m (c) d 0.01 m
Answers: 2
question
Engineering, 04.07.2019 18:10
What are the two (02) benefits, which may result from a successful implementation of preventive maintenance (pm) program in an organization? (clo3)a)- lean manufacturing b)-overlapping responsibilities c)-the planner is not qualified d)-accurate contractor information e)-reduction in equipment redundancies f)-accurate stores information
Answers: 3
question
Engineering, 04.07.2019 18:20
Asimple rankine cycle uses water as the working fluid. the water enters the turbine at 10 mpa and 480c while the condenser operates at 6 kpa. if the turbine has an isentropic efficiency of 80 percent while the pump has an isentropic efficiency of 70 percent determine the thermal efficiency
Answers: 1
question
Engineering, 04.07.2019 18:20
An open feedwater heater operates at steady state with liquid entering at inlet 1 with t? = 40°c and pl = 1 .2 mpa. water vapor att2-200°c and p2 = 1.2 mpa enters at inlet 2. saturated liquid water exits with a pressure of pa 1.2 mpa. neglect heat transfer with the surroundings and all kinetic and potential energy effects, determine the mass flow rate of steam at inlet 2 if the mass flow rate of liquid water at inlet 1 is given as 2 kg/s.
Answers: 3
You know the right answer?
In this exercise, you will write a Point structure that represents a space in two-dimensional space....
Questions
question
Mathematics, 03.12.2020 04:20
question
Mathematics, 03.12.2020 04:20
question
Chemistry, 03.12.2020 04:20
question
Mathematics, 03.12.2020 04:20
question
Mathematics, 03.12.2020 04:20
Questions on the website: 13722367