Tug As 9

  • Uploaded by: Gandalivs
  • 0
  • 0
  • June 2020
  • 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 Tug As 9 as PDF for free.

More details

  • Words: 107
  • Pages: 2
9.1.2

Package adalah sebuah kelas yang terkait dan dikelompokan dalam sebuah unit yang membentuk paket(package).

9.1.3

Pendeklarasian package secara umum : package nama_paket berikut contoh sintaxnya : package algoritma; public class pangkat { public void hasil(int x) { x=x*x*x; System.out.print(x) ; } }

9.1.3

FlowChart :

Output :

SourceCode Package : package algoritma; public class pangkat { public void hasil(int ang) { x=ang*ang*ang; System.out.print(x) ; } } SourceCode main : import java.io.*; import algoritma.pangkat; public class cetak { public static void main(String [] args)throws Exception { DataInputStream ipt=new DataInputStream(System.in); pangkat xxx=new pangkat(); System.out.print("input nilai = "); int ang=Integer.parseInt(ipt.readLine()); System.out.print("hasil pangkat "+ang+" = "); xxx.hasil(ang); System.out.println(); } }

Related Documents

Tug As 9
June 2020 20
Tug As
April 2020 22
Tug As
November 2019 29
Tug As
June 2020 25
Tug As
June 2020 21
Tug As
June 2020 16

More Documents from ""

Tug As 9
June 2020 20
Modul 4,5,6 Revisi
June 2020 25
Tugas Praktikum O9
June 2020 16
Modul 78
June 2020 18