Pages

This is default featured post 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured post 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured post 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured post 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

This is default featured post 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.

Selasa, 27 Maret 2012

Kamis, 08 Maret 2012

Program Java: Membuat Menu Rumus Matematika 

Lagi iseng-iseng bantu temen, heheh bikin program java buat rumus matematika.
contoh rumusnya seperti ini :
1. y=2x+5
2. y=2a(x-2)
3. y=-1/x2-1
4. c2=a2+b2
x2,c2,b2,a2 mksdnya x,c,b,a pangkat 2

Screen shot program:




Coding:

import java.io.*;

public class InputanMenuRumus
{
public static void main(String[] args) throws Exception
{
BufferedReader kata = new BufferedReader(new InputStreamReader(System.in));

int pil;

do
{

System.out.println("MENU :");
System.out.println(" 1.Rumus y=2x+5 ");
System.out.println(" 2.Rumus y=2a(x-2) ");
System.out.println(" 3.Rumus y=-1/x2 - 1 ");
System.out.println(" 4.Rumus c2=a2+b2 ");
System.out.println(" 5.Exit ");
System.out.println("PILIHAN [1-5] : ");

pil=Integer.parseInt(kata.readLine());

}while(pil <1 || pil>5);

if (pil == 1)
{
System.out.println("Rumus y=2x+5");
//membuat turunan class untuk input dari user
BufferedReader dataIn=new BufferedReader(new InputStreamReader(System.in));
System.out.print("Masukan nilai x: ");
int x = Integer.parseInt(dataIn.readLine());
int total =((2*x)+5);
System.out.print("Rumus y=2x+5= ");
System.out.println(total);
}
if (pil == 2)
{
System.out.println("Rumus y=2a(x-2)");
//membuat turunan class untuk input dari user
BufferedReader dataIn=new BufferedReader(new InputStreamReader(System.in));
System.out.print("Masukan nilai x: ");
int x = Integer.parseInt(dataIn.readLine());
System.out.print("Masukan nilai a: ");
int a = Integer.parseInt(dataIn.readLine());
int total =((2*a)*(x-2));
System.out.print("Rumus y = 2a(x-2)= ");
System.out.println(total);
}
if (pil == 3)
{
System.out.println("Rumus y=-1/x2 - 1");
//membuat turunan class untuk input dari user
BufferedReader dataIn=new BufferedReader(new InputStreamReader(System.in));
System.out.print("Masukan nilai x: ");
double x = Double.parseDouble(dataIn.readLine());
double k = (x*x);
double total =(((-1)/k)-1);
System.out.print("Rumus y=-1/x2 - 1= ");
System.out.println(total);
}
if (pil == 4)
{
System.out.println("Rumus c2=a2+b2");
//membuat turunan class untuk input dari user
BufferedReader dataIn=new BufferedReader(new InputStreamReader(System.in));
System.out.print("Masukan nilai a: ");
int a = Integer.parseInt(dataIn.readLine());
System.out.print("Masukan nilai b: ");
int b = Integer.parseInt(dataIn.readLine());
int total =((a*a)+(b*b));
System.out.println("");
System.out.print("Rumus c2=a2+b2= ");
System.out.println(total);
}
else if (pil == 5)
{
System.out.println("Anda Memilih keluar ");
}
}


}

 

Sabtu, 03 Maret 2012

Jumat, 02 Maret 2012

Kamis, 01 Maret 2012

Mozilla Bakal Buka Toko Aplikasi Pesaing App Store dan Android MarketMozilla, 

                   Fenomena Hari Tanpa Bayangan Matahari

Share

Twitter Delicious Facebook Digg Stumbleupon Favorites