I don't start Java Programming until next year so:
You must be registered for see links
and
You must be registered for see links
or both at once
You must be registered for see links
import java.util.Scanner;
Scanner input = new Scanner(System.in);
System.out.println("Please input Length");
int length = input.nextInt();
System.out.println("Please input Width");
int width = input.nextInt();
System.out.println("Your Area Is: " + getArea(length,width);
public int getArea(int x, int y){
int total = x * y;
return total;
}
Use the forumla?
Area - length * width
Perimter - 2 * length + 2 * width
You want to use a input so
Something like this: I did this quick so
Code:import java.util.Scanner; Scanner input = new Scanner(System.in); System.out.println("Please input Length"); int length = input.nextInt(); System.out.println("Please input Width"); int width = input.nextInt(); System.out.println("Your Area Is: " + getArea(length,width); public int getArea(int x, int y){ int total = x * y; return total; }
DO not just copy this code, understand it and elaborate it a little more