Variables Review Doc

This commit is contained in:
2026-10-29 13:33:45 -04:00
parent 7758699dde
commit 10e1ead94c
9 changed files with 110 additions and 93 deletions
+20
View File
@@ -0,0 +1,20 @@
import java.util.Scanner;
public class RectangleArea {
public RectangleArea() {}
public void display() {
Scanner scanner = new Scanner(System.in);
System.out.print("Length of the rectangle:");
int length = scanner.nextInt();
System.out.print("Width of the rectangle:");
int width = scanner.nextInt();
System.out.printf("The area of the rectangle is: %d", length*width);
}
public static void main(String[] args) {
RectangleArea r = new RectangleArea();
r.display();
}
}