Program Pasien Rumah Sakit Update

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

package pasienarray;
import java.util.Scanner;
/**
*
* @author ANGGA
*/
public class Main {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Scanner data=new Scanner(System.in);
int biayaPasien=0;
int biayaTotal=0;

System.out.println(“AYUK BEROBAT\n===============”);
System.out.print(“Berapa Pasiennya : “);
int pasien=data.nextInt();
String[][] arrayKeluhan=new String[pasien][];
int[][] arrayHarga=new int[pasien][];

for(int i=0;i<pasien;i++){
System.out.println(“——————————–\nPASIEN KE-“+(i+1));
System.out.print(“Berapa Keluhan Pasien “+(i+1)+” : “);
int jmlKeluhan=data.nextInt();
arrayHarga[i]=new int[jmlKeluhan];
arrayKeluhan[i]=new String[jmlKeluhan];
biayaPasien=0;
for(int j=0;j<jmlKeluhan;j++){
System.out.print(” – Keluhan ke “+(j+1)+” : “);
String keluhan=data.next();
arrayKeluhan[i][j]=keluhan;
System.out.print(”   *Bayar Dokter Sakit “+keluhan+” : “);
int bayar=data.nextInt();
arrayHarga[i][j]=bayar;

biayaPasien+=arrayHarga[i][j];
biayaTotal+=arrayHarga[i][j];
}
System.out.println(“Total Biaya Pasien “+(i+1)+” : “+biayaPasien);
}
System.out.println(“\n**Total Biaya Berobat Pasien : “+biayaTotal);

//hasil array yang disimpan////////////////////////////////////////////////////////////////
System.out.println(“\n=========================\nREKAP RUMAH SAKIT HARI INI\n=========================”);
System.out.println(“Hari ini ada “+pasien+” pasien\n————————-“);
for(int  i=0;i<arrayKeluhan.length;i++){
for(int j=0;j<arrayHarga[i].length;j++){
System.out.println(“Pasien ke “+(i+1)+” Sakit “+arrayKeluhan[i][j]+” Bayar “+arrayHarga[i][j]);
}
System.out.println(“TOTAL BAYAR PASIEN “+(i+1)+” : “+biayaTotal+”\n———————————–“);
System.out.println();
}
System.out.println(“TOTAL UANG RUMAH SAKIT “+biayaTotal);

}

}

2 pemikiran pada “Program Pasien Rumah Sakit Update

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 )

Foto Google

You are commenting using your Google 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 )

Connecting to %s