{{#items}}

{{text}}

{{/items}} {{ctaText}}

{{#items}} {{/items}}

showing results for - "perimeter of rectangle java program"

Juan José

09 Aug 2019

```
1import java.util.Scanner;
2public class PerimeterOfRectangleDemo
3{
4 public static void main(String []args)
5 {
6 float length, width, perimeter;
7 Scanner sc = new Scanner(System.in);
8 System.out.print("Please enter length of rectangle: ");
9 length = sc.nextFloat();
10 System.out.print("Please enter width of rectangle: ");
11 width = sc.nextFloat();
12 perimeter = 2 * (length + width);
13 System.out.println("Perimeter of rectangle: " + perimeter);
14 sc.close();
15 }
16}
```

Tyler

28 Jan 2020

```
1Scanner sc = new Scanner(System.in);
2System.out.println("Enter Width of the rectangle: ");
3double width = sc.nextDouble();
4System.out.println("Enter Height of the rectangle: ");
5double height = sc.nextDouble();
6sc.close();
7// Logic for finding the perimeter of the rectangle
8double perimeter = 2 * (width + height);
9System.out.println("Perimeter of Rectangle: " + perimeter);
```

Todd

07 Mar 2017

```
1import java.util.Scanner;
2
3public class RectanglePerimeter {
4 public static void main(String[] args) {
5 new RectanglePerimeter().getValues();
6 }
7
8 //get user input from console
9 public void getValues() {
10 Scanner sc=new Scanner(System.in);
11
12 double length= sc.nextDouble();
13
14 double breadth=sc.nextDouble();
15 RectanglePerimeter obj=new RectanglePerimeter();
16 double result= obj.perimeterCalculator(length,breadth);
17 System.out.println(result);
18
19 }
20
21 //write logic to find perimeter of rectangle here
22 public double perimeterCalculator(double length, double breadth) {
23 double perimeter=(2*length)+(2*breadth);
24 return perimeter;
25
26
27
28 }
29}
```

similar questions

calculate area of rectangle using class in javajava program to calculate area of circle rectangle and triangle using switch statementprogram to find area of rectangle using inheritance in javacalculate area of rectangle using parameterised constructor in javaarea and perimeter of trapezium in javacalculate area of rectangle using constructor overloading in javajava program to find perimeter of squarejava program to calculate area of rectanglejava program to find the perimeter of the circlehow to give square in javawrite a java program to print the length and perimeter of a rectanglecalculate area of rectangle using default constructor in javaperimeter of parallelogram in javahow to create a rectangle in javaperimeter of rhombus in javahow to create a draw rectangle in javajava code for squarequeries leading to this page

perimeter of a rectangle equationhow do i get premiter on javaprint the area and perimeter of a rectangle and square constructer java source codethe smallest perimeter possible for a rectangle whose area is 400 square feet isfind the perimeter of rectanglejava program to find the perimeter of a rectanglewrite a java program to print the area and perimeter of a rectangleperimeter of a rectangle javajava program to calculate the area and the perimeter of a rectangleperimeter of rectangle java programwrite a java program to input the length and the width of a rectangle and calculate and print the perimeter write a program to find the perimeter of a rectangle which has a length of 10 and width of 7 in javaperimeter 28 29 methodjava program to calculate the perimeter of a rectanglearea and perimeter of rectangle in javacalculate rectangle area and perimeter with javajava program to find perimeter of a rectanglejava program to find perimeter of rectanglecalculate the perimeter of a rectangle in javaperimeter of rectangle in java using methodjava program to calculate the area and perimeter of a rectanglejava program perimeter of rectanglewrite a java program which uses a function to calculate the perimeter of a rectangle how to find the perimeter of a rectangle 3f in pythonjava program to calculate perimeter of rectangleperimeter of rectangle java program your answer for

you will get a confirmation link on this - you will have to click that for successful submission of your answer. we require this to keep the website free of spam, bots and unhelpful content

please ensure to add code which is syntactically corrent and executes properly

ask question on maxinterview

you will get a confirmation link on this - you will have to click that for successful submission of your question. we require this to keep the website free of spam, bots and unhelpful content

please be clear, to the point and respectful