Hey guys! I have a program I am writing that I have gotten stuck on. It compiles fine but when I run it I get several error messages. Illegal format Conversion Exception is one of the error messages. I am stuck and I don't see where the error is. Any insight or guidance would be greatly appreciated! Thank you all in advance!
import java.util.Scanner;
public class Circles
{
double radius = 1;
public Circles( double rad )
{
radius = rad;
}
public void setRadius( double rad)
{
radius = rad;
}
public Double getRadius()
{
return radius;
}
public void displayMessage()
{
System.out.printf( "The radius of the circle is \n%d!\n", getRadius() );
}
public void determinePerimeter()
{
double perimeter;
perimeter = 2 * getRadius() * 3.1415;
System.out.printf( "The perimeter is: %d!\n", perimeter );
}
public void determineArea()
{
double area;
area = getRadius() * getRadius() * 3.1415;
System.out.printf( "The area is: %d!\n", area );
}
}
import java.util.Scanner;
public class CirclesTest
{
public static void main( String[] args )
{
Circles myCircles = new Circles( 1.00 );
Scanner input = new Scanner( System.in );
System.out.print( "Please enter radius of circle:");
myCircles.radius = input.nextDouble();
myCircles.displayMessage();
myCircles.determinePerimeter();
myCircles.determineArea();
}
}