Guest User

Untitled

a guest
Jun 24th, 2018
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3.  
  4. public class test {
  5.     private static double PI = 3.14;
  6.     /**
  7.      * @param args
  8.      */
  9.     public static void main(String[] args) {
  10.         // TODO Auto-generated method stub
  11.         int yaricap;
  12.         do{
  13.             System.out.println("Lütfen yarı çapı giriniz veya çıkmak için -1 giriniz");
  14.             Scanner ender = new Scanner(System.in);
  15.             yaricap=ender.nextInt();
  16.             if(yaricap!=-1)
  17.             {
  18.                 System.out.println(dairealaniHesapla(yaricap));
  19.             }
  20.            
  21.         }while(yaricap!=-1);
  22.     }
  23.  
  24.     public static double dairealaniHesapla ( int yaricap )
  25.     {
  26.       return (yaricap*yaricap*PI);
  27.     }
  28.  
  29. }
Add Comment
Please, Sign In to add comment