Advertisement
CR7CR7

P06

Oct 10th, 2022
966
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.51 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class P06CalculateRectangleArea {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.  
  7.         int widthInput = Integer.parseInt(scanner.nextLine());
  8.         int lengthInput = Integer.parseInt(scanner.nextLine());
  9.  
  10.         int result = calculateArea(widthInput, lengthInput);
  11.  
  12.         System.out.println(result);
  13.     }
  14.  
  15.     public static int calculateArea(int width, int length) {
  16.         return width * length;
  17.     }
  18. }
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement