Question: Write a program that prompts the user to enter a point (x, y) and checks whether the point is within the circle centered at (0,

Write a program that prompts the user to enter a point (x, y) and checks whether the point is within the circle centered at (0, 0) with radius 10. For example, (4, 5) is inside the circle and (9, 9) is outside the circle, as shown in Figure 3.7a.

A point is in the circle if its distance to (0, 0) is less than or equal to 10. The formula for computing the distance is ?(x2 - x1)2 + (y2 - y1)2. Test your program to cover all cases.) Two sample runs are shown below.

Enter a point with two coordinates: 4 5 -Enter Point (4.0, 5.0)

Figure?

is in the circle Enter a point with two coordinates: 99 FEnter

Enter a point with two coordinates: 4 5 -Enter Point (4.0, 5.0) is in the circle Enter a point with two coordinates: 99 FEnter Point (9.0, 9.0) is not in the circle y-axis -is (9, 9) (4, 5) (6, 4) (2, 2) (0,0) (0, 0) -is -is (a) (b)

Step by Step Solution

3.39 Rating (177 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Output Enter a point with two coordinates 45 Point 40 50 is in ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Java Programming Questions!