This might be easy for some of y'all, but I'm very new and I'm stuck. I'm not sure how to get past this.
public class JavaClass{ public static void main (String [] args){ System.out.println("Welcome to Matthew Galetti's Rectangle and Square Calculator"); //System.out.println("Rectangle Width Value"); //int number = 6; //System.out.print(number); //System.out.println("Rectangle Length Value"); //int number2 = 20; //System.out.print(number2); System.out.println("The Area of the Rectangle is 120"); int product = number * number2; //20*6=120 int number = 120; System.out.print(product); System.out.println("The Perimeter of the Rectangle is 52"); int sum = number + number + number2 + number2; //6+6+20+20=52 int number = 52; System.out.print(sum);
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
JavaClass.java:21: error: cannot find symbol
int product = number * number2;
^
symbol: variable number
location: class JavaClass
JavaClass.java:21: error: cannot find symbol
int product = number * number2;
^
symbol: variable number2
location: class JavaClass
JavaClass.java:27: error: cannot find symbol
int sum = number + number + number2 + number2;
^
symbol: variable number2
location: class JavaClass
JavaClass.java:27: error: cannot find symbol
int sum = number + number + number2 + number2;
^
symbol: variable number2
location: class JavaClass
JavaClass.java:29: error: variable number is already defined in method main(String[])
int number = 52;
^
5 errors
all those errors marks are underneath the n's in the N's in the word numbers. When I put it into the post they didn't come out that way.