Question: 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

 Java Language r2 7. Write a class method, totalPerimeter, that has

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

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!