Kiraluasbilik
unknown
java
3 years ago
958 B
5
Indexable
Never
import java.util.Scanner; class Main { public static void main(String[] args) { Scanner input = new Scanner(System.in); Scanner input2 = new Scanner(System.in); System.out.println("Program mengira luas bilik"); System.out.println("................................."); System.out.print("Taipkan nama bilik : "); String namabilik = input.nextLine(); System.out.print("Berapakah ukuran panjang bilik (dalam meter)? : "); double panjang = input2.nextDouble(); System.out.print("Berapakah ukuran lebar bilik (dalam meter)? : "); double lebar = input2.nextDouble(); namabilik = namabilik; double luas = panjang * lebar; System.out.println("......................................................................."); System.out.println("Keluasan bagi " + namabilik + " adalah " + luas + " meter persegi."); } }