hi i am a total beginner at java code.
i am trying to write a program for this problem.
Land Calculation
One acre of land is equivalent to 43,560 square feet. Write a program
that calculates the number of square feet in a tract of land with 3.5
acres. Hint: Multiply the size of the tract of land (in acres) by the
number of square feet in an acre to get the number of square feet in
the tract.
a) You must have a variable called nrAcres where you will store the
number of acres in the track.
b) Output must look as follows:
Size of land in acres: 3.5
Size of land in square feet: 152460
c) if the value of the variable nrAcres is changed the output should
change accordingly. In other words: it would be wrong to have the
following statement:
System.out.println("Size of land in square feet: 152460");
previous statement will print the correct output but will not change
if you change the value of nrAcres.
this is what i got so far
public class Land
{
public static void main(String[] args){
double nrAcres = 3.5;
int feetInAcre = 43560;
double feetInTract = nrAcres * feetInAcre;
System.out.println("Size of land in acres: " + nrAcres + "\nSize of land in square feet: " + feetInTract);
}
}
i tried to compile it but it says
error: class names, Land, are only accepted if annotation is explicitly requested 1 error
what is wrong with my code