Advertisement
satriafu5710

Luas & Volume Prisma Segitiga Java

Dec 7th, 2020
1,478
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.78 KB | None | 0 0
  1. package com;
  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 La, Ka, tinggi, luasP, volume;
  11.  
  12.         System.out.println("\t Luas Permukaan & Volume Prisma Segi 3\n");
  13.  
  14.         System.out.print("\n Masukkan Luas Alas     : ");
  15.         La = userInput.nextFloat();
  16.  
  17.         System.out.print(" Masukkan Keliling Alas : ");
  18.         Ka = userInput.nextFloat();
  19.  
  20.         System.out.print(" Masukkan Tinggi        : ");
  21.         tinggi = userInput.nextFloat();
  22.  
  23.         luasP = (2 * La) + (Ka * tinggi);
  24.         System.out.println("\n Luas Permukaannya  : " + luasP);
  25.  
  26.         volume = La * tinggi;
  27.         System.out.println(" Volumenya          : " + volume);
  28.     }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement