Advertisement
satriafu5710

Luas & Volume Bola Java

Dec 7th, 2020
890
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.61 KB | None | 0 0
  1. package com.tutorial;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Main {
  6.  
  7.     public static void main(String[] args) {
  8.         Scanner userInput = new Scanner(System.in);
  9.  
  10.         float phi = 3.14f;
  11.         float rusuk, luas, volume;
  12.  
  13.         System.out.println("\t Luas dan Volume Bola \n");
  14.  
  15.         System.out.print("\n Masukkan Rusuk : ");
  16.         rusuk = userInput.nextFloat();
  17.  
  18.         luas = 4 * phi * rusuk * rusuk;
  19.         System.out.println("\n Luas Bola   : " + luas);
  20.  
  21.         volume = 4 / (float) 3 * phi * rusuk * rusuk * rusuk;
  22.         System.out.println(" Volume Bola : " + volume);
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement