Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.tutorial;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner userInput = new Scanner(System.in);
- float phi = 3.14f;
- float r, tinggi, luasP, volume;
- System.out.println("\t Hitung Luas Permukaan dan Volume Tabung \n\n");
- System.out.print(" Masukkan Jari-jari : ");
- r = userInput.nextFloat();
- System.out.print(" Masukkan Tinggi : ");
- tinggi = userInput.nextFloat();
- luasP = 2 * phi * r * (r + tinggi);
- System.out.println("\n Luas Permukaannya : " + luasP);
- volume = phi * r * r * tinggi;
- System.out.println(" Volume Tabungnya : " + volume);
- }
- }
Add Comment
Please, Sign In to add comment