Question: please help me, java for begginers? Lab 08: Console Input and Output Lab Exercise 4 - Is a Given Point inside a Circle Problem Description:
Lab 08: Console Input and Output Lab Exercise 4 - Is a Given Point inside a Circle Problem Description: Write a Java program (PointInside Circle.java) that asks the user to input a point with coordinates (x, y) and tests if the given point is inside a circle with the center (0,0) and the radius r. Tips: calculate the distance between (0,0) and (x, y) as follows: distance = (x - x)2 + (y - y)2 The point (x, y) is inside the circle, if distance Sr. In practice, squaring is often much cheaper than taking the square root. Hence, you may compare distance? with r- instead. Thus, you may use the following formula: (x - x) + (1 - y.)? Sr. tendah Sample output: Enter x coordinate: 4 Enter y coordinate: 5 Enter radius of circle: 104 The point (4.0, 5.0) is inside the circle. Enter x coordinate: 9 Enter y coordinate: 124 Enter radius of circle: 8 The point (9.0, 12.0) is outside the circle
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
