Triangle

  • Uploaded by: awaloeddin devie
  • 0
  • 0
  • October 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Triangle as PDF for free.

More details

  • Words: 114
  • Pages: 1
/** * triangle * @author devi.az [460502560] */ import java.io.*; import static java.lang.Math.*; //import to used sqrt function public class triangle { public static void main (String[] args) throws Exception { double t, a, luas, keliling, temp; DataInputStream dis = new DataInputStream (System.in); System.out.print("Masukkan nilai tinggi segitiga : "); t = Double.parseDouble(dis.readLine()); //read tinggi System.out.print("Masukkan nilai alas segitiga : "); a = Double.parseDouble(dis.readLine()); //read alas temp = Math.sqrt((t * t) + (a * a)); //calc sisi miring luas = (a * t)/2; //calc luas keliling = a + t + temp; //calc keliling System.out.println("Luas segitiga adalah : " + luas); System.out.println("Keliling [diasumsikan sebagai segitiga siku siku] segitiga adalah : " + keliling); } }

Related Documents

Triangle
May 2020 34
Triangle
November 2019 36
Triangle
October 2019 38
Triangle
October 2019 43
Triangle
June 2020 41
Triangle
October 2019 33

More Documents from ""

Triangle
October 2019 38