Advertisement
Fakhru

Untitled

Jun 29th, 2014
280
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. /*
  2. * To change this template, choose Tools | Templates
  3. * and open the template in the editor.
  4. */
  5. package inputstring;
  6. import java.util.Scanner;
  7. import java.text.*;
  8. /**
  9. *
  10. * @author MPA3
  11. */
  12. public class InputString {
  13.  
  14. /**
  15. * @param args the command line arguments
  16. */
  17. public static void main(String[] args) {
  18.  
  19. double area,rad;
  20. final double pi = 3.142;
  21. Scanner scan = new Scanner(System.in);
  22. DecimalFormat df = new DecimalFormat("0.00");
  23. System.out.print("Input Radius: ");
  24. rad = scan.nextDouble();
  25. area = pi * rad * rad;
  26. System.out.println("Area of circle: "+df.format(area));
  27.  
  28.  
  29.  
  30.  
  31.  
  32. }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement