I'm trying to code something simple that asks the user for a radius and an angle so that it can calculate the cartesian coordinates x and y, but I'm very new to any kind of coding and can't seem to get it right. At the moment, when I try to compile it I have the error: cannot find symbol (the final printf line) I've gone through my lecture slides and searched on google for ages now and nothing seems to work, I feel like I must be missing something super obvious and simple. That or my whole code is a mess, I really don't know what I'm doing here so any help would be appreciated. Is the out.printf written wrong, what am I missing?? Or the following string, I don't fully understand the \n so maybe that's where i've messed up? Any help would be amazing, this is only my second piece of code and I'm really learning through trial by error.
import java.util.Scanner; //import scanner and math class
class Cartesian
{
public static void main(String[] args)
{
// Create a scanner that can read numbers, or words
Scanner input = new Scanner(System.in);
System.out.print("Enter the radius");
double radius = input.nextDouble();
System.out.print("Enter the angle");
double angle = input.nextDouble();
// given formulas
double xValue = radius*cos(angle);
double yValue = radius*sin(angle);
// formatted output
out.printf("x equals %.1f and y equals %.1f \n", (xValue),(yValue));
}
}