Koding Java untuk Lingkaran


/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package javaapplication1;

/**
*
* @author COMPAQ
*/
import java.util.*;

public class NewClass
{
public static void main(String[] args)
{
Scanner input = new Scanner(System.in);

double phi = 3.14;
double r, luas;

System.out.println(“Program Luas Lingkaran\n”);
System.out.print(“Masukkan Panjang Jari-jari : “);
r = input.nextDouble();

luas = 0.5 * phi * r * r;

System.out.print(“Luas Lingkaran = ” + luas + “\n\n”);
}
}

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s