Advertisement
witchway915

Untitled

Aug 27th, 2014
226
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. import java.util.Scanner; // program uses class Scanner
  2.  
  3. public class SCarroll_Assign3_28 {
  4.  
  5.  
  6. public static void main(String[] args) {
  7.  
  8. Scanner input = new Scanner( System.in );
  9.  
  10. int radius;
  11. int diameter;
  12. int area;
  13.  
  14. System.out.print( "Enter number for the Radius. " );
  15. radius = input.nextInt();
  16.  
  17. area = radius * radius;
  18. diameter = radius * 2;
  19.  
  20. System.out.printf( "Diameter of the circle is %d\n", radius * 2 );
  21.  
  22. System.out.printf( "Circumference of the circle is %f\n", Math.PI * diameter );
  23.  
  24. System.out.printf( "Area of the circle is %f\n.", Math.PI * area );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement