Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java Language r2 7. Write a class method, totalPerimeter, that has two Rectangle parameters. The method should return the total perimeter of the figure formed

image text in transcribed

Java Language

r2 7. Write a class method, totalPerimeter, that has two Rectangle parameters. The method should return the total perimeter of the figure formed by the two rectangles. It should only count those portions that are on the edges of the exterior of the resulting figure. If one rectangle is completely contained by the other, then return the perimeter of the outer rectangle. If the rectangles do not intersect, the method should return the sum of the individual perimeters. Success Criteria: (Sample run): > Use the tester class to invoke the method totalPerimeter and return the total perimeter of the composite shape. Check all three test cases a) Rectangles form a composite shape b) Rectangles do not touch c) rectangles are contained. r2 7. Write a class method, totalPerimeter, that has two Rectangle parameters. The method should return the total perimeter of the figure formed by the two rectangles. It should only count those portions that are on the edges of the exterior of the resulting figure. If one rectangle is completely contained by the other, then return the perimeter of the outer rectangle. If the rectangles do not intersect, the method should return the sum of the individual perimeters. Success Criteria: (Sample run): > Use the tester class to invoke the method totalPerimeter and return the total perimeter of the composite shape. Check all three test cases a) Rectangles form a composite shape b) Rectangles do not touch c) rectangles are contained

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

More Books

Students also viewed these Databases questions