Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

Using C++ Write a function called Distance that calculates the distance between two points. - Calculate distance as square root of (x1-x2)*(x1-x2)+(y1-y2)*(y1-y2). - sqrt() function

Using C++

Write a function called Distance that calculates the distance between two points.

- Calculate distance as square root of (x1-x2)*(x1-x2)+(y1-y2)*(y1-y2).

- sqrt() function calculates the square root. You need to include math.h

Write a main function that

- Asks the user to define a circle using the X and Y coordinates of its center (CX and CY) and the value of its radius (R)

- Stays in a loop and asks the user to enter coordinates of a point, detects and prints if the point is inside the circle, on the circle, or outside the circle.

Write a function named InRect that detects if a point is inside a rectangle.

- No need to use it in the main.

- Determine what parameters and return type the function needs to have. It should not rely on any global variables and receive information about the rectangle and point as a parameter.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle 12c SQL

Authors: Joan Casteel

3rd edition

1305251032, 978-1305251038

More Books

Students explore these related Databases questions