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);