-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathluasSegitiga.java
More file actions
35 lines (26 loc) · 849 Bytes
/
Copy pathluasSegitiga.java
File metadata and controls
35 lines (26 loc) · 849 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package apphitungsegitiga;
import java.util.Scanner;
/**
*
* @author ASUS
*/
public class luasSegitiga {
public double alas;
public double tinggi;
public double rumus = 0.5;
public double luasSegitiga;
Scanner nilai = new Scanner(System.in);
void luasSegitiga(){
System.out.print("masukkan nilai alas: ");
alas = nilai.nextDouble();
System.out.print("masukkan nilai tinggi: ");
tinggi = nilai.nextDouble();
luasSegitiga = rumus * alas * tinggi;
System.out.println("luas segitiga "+luasSegitiga +"cm");
}
}