ni kemari aku bikin program java,ya... walaupun kurang sempurna...tapi alhamdulilah dah bisa menuhin tugas Q...ni sourcode nya....
--------------------------------------------------------------
/**
* @(#)Jats.java (java aplikasi toko sederhana)
*
*
* @author Ravita Eka Dewi
* @version 1.00 2010/4/29
*/
import java.io.*;
public class Jats{
private int n=1;
private String[] arrKode = new String[100],arrNama = new String[100];
private double[] arrJumlah = new double[100];
void input()
{
BufferedReader input=new BufferedReader(new InputStreamReader(System.in));
try
{
String jawab="y";
int i=0;
while(jawab.equalsIgnoreCase("y"))
{
System.out.print("Masukkan jenis barang : ");arrKode[i]=input.readLine();
System.out.print("Masukkan nama barang : ");arrNama[i]=input.readLine();
System.out.print("Masukkan jumlah barang : ");arrJumlah[i]=Double.valueOf(input.readLine());
this.n=i+1; i++;
System.out.println("\n");
System.out.print("Mau input data barang lagi ?'Y/N': ");jawab=input.readLine();
System.out.println(":::::::::::::::::::::::::::::::::::::::::::::\n");
}
}
catch (Exception e)
{
System.out.println("ERROR : "+e);
}
}
void output()
{
System.out.println("Daftar Barang Masuk ");
System.out.println(":::::::::::::::::::::::::::::::::::::::::::::");
System.out.println("Jenis"+"\t"+"Nama"+"\t"+"Jumlah");
for(int i=0;i
System.out.println(":::::::::::::::::::::::::::::::::::::::::::::\n");
}
public static void main (String[] args) {
BufferedReader entry=new BufferedReader(new InputStreamReader(System.in));
System.out.println(":::::::::::::::::::::::::::::::::::::::::::::");
System.out.println("\t APLIKASI TOKO SEDERHANA ");
System.out.println("\t by : Ravita Eka Dewi ");
System.out.println(":::::::::::::::::::::::::::::::::::::::::::::");
try
{
int pilih ;
do{
System.out.println("\t\t\tMENU");
System.out.println("\t\t1-->Input & Data Barang Masuk");
System.out.println("\t\t2-->Lihat Barang");
System.out.println("\t\t3-->Laporan");
System.out.println("\t\t0-->Selesai");
System.out.println(":::::::::::::::::::::::::::::::::::::::::::::\n");
System.out.print("Pilih Menu : ");
pilih =Integer.valueOf(entry.readLine());
System.out.println(":::::::::::::::::::::::::::::::::::::::::::::\n");
switch(pilih)
{
case 0 : break;
case 1 :{
Jats js =new Jats();
js.input();
js.output();
break;
}
case 2 :{
Jats js =new Jats();
js.output();
System.out.println("Proses Belum Berhasil masih terjadi gangguan\n");
break;
}
case 3 :{
System.out.println("Proses Belum tersedia\n");
break;
}
default : System.out.println("Menu tidak tersedia!\n");
}
}while (pilih!=0);{System.out.println("Terima Kasih telah menggunakan jasa kami");} }
catch (Exception e)
{
System.out.println("ERROR : "+e);
}
}
}
download di sini
Sabtu, 19 Juni 2010
Tugas Java
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar