Answers for "The smallest perimeter possible for a rectangle whose area is 400 square feet is"

1

Java program to find perimeter of a rectangle

import java.util.Scanner;
public class PerimeterOfRectangleDemo
{    
   public static void main(String []args)
   {
      float length, width, perimeter;
      Scanner sc = new Scanner(System.in);
      System.out.print("Please enter length of rectangle: ");
      length = sc.nextFloat();
      System.out.print("Please enter width of rectangle: ");
      width  = sc.nextFloat();
      perimeter = 2 * (length + width);
      System.out.println("Perimeter of rectangle: " + perimeter);
      sc.close();
   }          
}
Posted by: Guest on February-09-2021
0

java program to find perimeter of rectangle

Scanner sc = new Scanner(System.in);
System.out.println("Enter Width of the rectangle: ");
double width = sc.nextDouble();
System.out.println("Enter Height of the rectangle: ");
double height = sc.nextDouble();
sc.close();
// Logic for finding the perimeter of the rectangle
double perimeter = 2 * (width + height);
System.out.println("Perimeter of Rectangle: " + perimeter);
Posted by: Guest on November-11-2020
0

calculate perimeter of rectangle in a class in python

class Rectangle:
    def __init__(self, width, length):
        self.length = length
        self.width = width
        
    
    def calculate_perimeter(self):
        
        return 2 * (self.width + self.length)
    
Rectangle_1 = Rectangle(3, 4)

print (Rectangle_1.calculate_perimeter())
Posted by: Guest on October-26-2020

Code answers related to "The smallest perimeter possible for a rectangle whose area is 400 square feet is"

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language