Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE READ ADDITIONAL REQUIREMENTS!!!!!! NO LOOPS OR IF STATEMENTS!!!!!! instead use math.max and math.min methods instead! Task An upright rectangle can be represented by two

PLEASE READ ADDITIONAL REQUIREMENTS!!!!!! NO LOOPS OR IF STATEMENTS!!!!!! instead use math.max and math.min methods instead! image text in transcribed
Task An upright rectangle can be represented by two diagonal points, say pl = (plx, ply) and p2 = (p2x, pZy). A circle can be represented by its center point and radius, say (cx, cy) andr. Write a Java program that asks the user to input the points representing two up-right rectangles r1 and r2 and finds the largest circle c that can be contained in both rectangles, where (cx, cy) is the center of cand r the radius of c. Assume the two rectangles overlap and have sides parallel to the x and y axis. To be contained in the rectangles, the circle can touch the sides of the rectangles, but the circle's edge may not extend past the sides of either rectangle. Some sample runs for testing: ripl r1p2 r2p1 r2p2 c: (cx, cy) and r (0,4) (3,1) (1,0) (4,3) (2.0,2.0) and 1.0 (0,0) (3,4) (1,1) (4,3) (2.0,2.0) and 1.0 (1,0) (5,5) (0,4) (6,1) (3.0,2.5) and 1.5 Create a project and class named Lab3FirstnameLastname using your actual first and last names in NetBeans to contain your program. Additional Assignment Requirements 1. You may not use any concepts not yet taught in this course like loops or IF statements. Use Math.max() and Math.min build-in Math methods instead. 2. Your program should allow the user to input two diagonal points in any order as shown in the samples above

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

Students also viewed these Databases questions