Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- * To change this template, choose Tools | Templates
- * and open the template in the editor.
- */
- package inputstring;
- import java.util.Scanner;
- import java.text.*;
- /**
- *
- * @author MPA3
- */
- public class InputString {
- /**
- * @param args the command line arguments
- */
- public static void main(String[] args) {
- double area,rad;
- final double pi = 3.142;
- Scanner scan = new Scanner(System.in);
- DecimalFormat df = new DecimalFormat("0.00");
- System.out.print("Input Radius: ");
- rad = scan.nextDouble();
- area = pi * rad * rad;
- System.out.println("Area of circle: "+df.format(area));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement