1. My program is supposed to calculate the squares of the numbers from 1 to twelve, then display them in a chart for showing the number and their square. I am supposed to use two methods but i'm having trouble how. Please help and tell me what is wrong

CODE:
import java.io.*;

public class findingSquares
{
public static void main (String [] args) throws IOException
{

System.out.println("Number " + "Square");

findSquare root = new findSquare();

int numSquare = root.square();

int num = 0;

while (num >= 0 && num <= 11)
{
num++;
System.out.println(num + "\t" + numSquare);
}
}

public static int findSquare (String square)
{
int num = 1;
int numSquare = num * num;

return numSquare;
}
}

2.

3. Originally Posted by samanthaxc
import java.io.*;

public class findingSquares {
public static void main (String [] args) throws IOException {
System.out.println("Number " + "Square");
findSquare root = new findSquare();
int numSquare = root.square();

int num = 0;
while (num >= 0 && num <= 11) {
num++;
System.out.println(num + "\t" + numSquare);
}
}

public static int findSquare (String square) {
int num = 1
int numSquare = num * num;
return numSquare;
}
}
hard to know where to start, there's so many things that don't fit together

(1) what's findSquare root supposed to refer to, since you have not created an object called findSquare
(2) what's your method findSquare() supposed to do, since the only vaguely similar method carries a string argument
(3) i assume root.square() is supposed to square your number, but afaik the proper ways to square a number are
a * a, a ^ 2 or Math.pow(a,2)
(4) also you seem to square your number outside your loop, so how do you expect numSquare to change its value
(5) in your findSquare method it would appear that all you can return is a value of 1, since that's the value you assign to num, and which you then square

try something like this instead - haven't tested it so can't be sure if it's the correct answer, but it should be a lot closer than your attempt

import java.io.*;

public class findingSquares {
public static void main (String [] args) throws IOException {
// 1st method
System.out.println("Number " + "Square");

for (int i = 0; i < 12; i++) {
System.out.println((i + 1) + "\t" + ((i + 1) ^ 2));
}

// 2nd method
System.out.println("Number " + "Square");

for (int i = 0; i < 12; i++) {
System.out.println((i + 1) + "\t" + findSquare(i + 1));
}

}

private int findSquare (int num) {
return num * num;
}
}