Gregory R. answered 09/21/20
Software and Database Development, Technical Interview Preparation
To solve this, let's define perimeter as a sum of all sides of this rectangle, which we know is equal to 85 cm:
Perimeter = Length + Length + Width + Width
Since Length is 1 cm less than twice the width: Length = Width + Width - 1
When we substitute that into the formula for Perimeter, we get:
Perimeter = Width + Width + 2*(Width + Width - 1) => Width + Width + 2*Width + 2*Width - 2 = 85
=> 6*Width = 85 + 2 => Width = 87/6 = 14.5 => Length = 2*14.5 - 1 = 28
To verify, we calculate the perimeter using these values:
28 + 28 + 14.5 + 14.5 = 85