Perimeter of RectanglePerimeter of Rectangle could be considered as one of the characteristics or properties of the rectangle. It is the total distance covered by the rectangle. In Maths, you will come across many geometric shapes and sizes, which has an area, perimeter and even volume(for 3-d figures). You will also learn the formulas for all those parameters. Some of the examples of different shapes are circle, square, polygon, quadrilateral, etc.
The perimeter of a rectangle is found by adding up the length of all four sides. Since the two long sides are 12 cm, and the two shorter sides are 7 cm the perimeter can be found by: The perimeter is 38 cm. Perimeter of a Rectangle. It's not possible to determine the perimeter of a rectangle given only the area. The area of a rectangle depends on two unknowns, the length and the width, so you must be.
In this article, we will study the key feature of the rectangle, i.e. Perimeter.Perimeter basically gives the length of the figure. Suppose for a square, which has all its sides as equal, the perimeter of the square will be four times of its sides. In case of a circle, the perimeter is termed as circumference, which is calculated based on its radius.
Before we find out the perimeter of a given rectangle, let us learn first, what a rectangle is.Perimeter of a Rectangle FormulaThe perimeter of a rectangle is defined as the sum of all the sides of a rectangle. For any polygon, the are the total distance around its sides. In case of a rectangle, the opposite sides of a rectangle are equal and so, the perimeter will be twice the width of the rectangle plus twice the height of the rectangle and it is denoted by the alphabet “p”. Let us derive the formula for its perimeter and area.Suppose a rectangle has length and width as b and a respectively.From the definition of the perimeter we know, the perimeter of a rectangle, p = 2 ( a+b) unitswhere“a” is the length of the rectangle“b” is the breadth of the rectangle DerivationSince, the perimeter is equal to sum of all the sides of the polygon. Hence, in case of rectangle, the perimeter (P) is;P = sum of all its four sidesP = a+b+a+b (Opposite sides of rectangle are equal)P = 2(a+b)Hence, derived.Therefore.
Use one Scanner instance. Just reuse it. Lego hobbit sets uk. Scanner scanner = new Scanner (System.in);System.out.print('Please enter the length of the rectangle: ');double L = scanner.nextDouble;System.out.print('Please enter the length of the rectangle: ');double W = scanner.nextDouble;Update: You don't pass the L and W to the constructor as the other answer points out. However, some mistakes you made:. You declared length and width as static. Don't do that.
That makes no sense. The length and the width are properties of a rectangle and shouldn't be shared by all rectangle instances. You don't use the correct naming conventions: variables start with a lowercase character, class names start with an uppercase character. You are creating two instances of your Rectangle to calculate both perimeter and area of the same rectangle.
Share that instance instead.