I have been trying to build a Java program to prompt the user to enter the radius of a circle and the diameter, circumference, and area will be output through a "System.out.printf" statement. I can get the program to prompt for the radius and it will display the diameter, but will not identify the Area or Circumference. I keep getting an error with the Math variable. What could be wrong with this code for Area:
System.out.printf("Area is %d\n", (x * x * math.PI) );
NewToThis 0 Newbie Poster
wildgoose 420 Practically a Posting Shark
NewToThis 0 Newbie Poster
wildgoose 420 Practically a Posting Shark
BestJewSinceJC 700 Posting Maven
NewToThis 0 Newbie Poster
wildgoose 420 Practically a Posting Shark
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
NewToThis 0 Newbie Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
NewToThis 0 Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.