Program Pasien Rumah Sakit di Java

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

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

/**
* @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();

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

}
}

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