Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

java using while loop Sudent Name: Total Points (20 pts) Geometry: point in a rectangle? Problem Description: Write a program that prompts the wet to

java
using while loop
image text in transcribed
Sudent Name: Total Points (20 pts) Geometry: point in a rectangle? Problem Description: Write a program that prompts the wet to enter a point (, y) and checks whether the point is within the rectangle centered at (0, 0) with width 20 and bright 15. For example, (9.7) is inside the rectangle and (11,4) is outside the rectangle, as shown in the Figure. If the point is exactly on the border of the rectangle, make a special output for this scenario. For instance, the point (0, 7.5) should return that the point is on the border of the rectangle. So, we have three potential outputs: The point is within the rectanfle, the point is not within the rectangle, and the point is on one or more of the borders of the rectangle, 75 * (-9,7) (114) -10 10 while lo -75 loop bod Hication Hint: A point is in the rectangle if its horizontal distance to (o) is less than 20/2-10 and it vertical distance to (o) is less than 15/20 -75. Be aware of the difficulties encountered with floating point arithmetic night be best to hardcode these values to be sure you have an exact representation Hint: Work with double values/variables. That is the user should be able to enter points with the integer values o floating point values 371 words English (United States) Focus CHINTHI TV IN

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

Step: 3

blur-text-image

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

OpenStack Trove

Authors: Amrith Kumar, Douglas Shelley

1st Edition

1484212215, 9781484212219

More Books

Students also viewed these Databases questions