Tugas Array dan Inheritence Kelompok 5


SOAL BAB 8 NO 5

Define two classses , Patient and Billing, whose object are record for a clinic. Derive Patient from the class Person given in Listing 8.1. A Patient record has the patient’s name (defined in the class Person) and identificationnumber (use the type String). A Billing class will contains a Patient object and a Doctor object (from programming Project 4). Give your classes reasonable complement of constructors and accessor methods and an equal 1s method as well. First write a driver program that creates to test all your methods, then write a test program that creates at least two patients, at least two doctors, and at least two Billing record and then displays the total income from the Billing records.

PEMBAHASAN SOAL

Dalam sebuah program, terdapat 2 class yaitu Patient dan Billing yang mana objek nya adalah rekaman data dari sebuah klinik. Data pasien berasal dari class Person yang terdapat pada daftar 8.1. Dalam data seorang pasien terdapat nama pasien (berasal dari class Person) dan pengidentifikasian nomor dapat menggunakan variabel Strijngh. Class Billing akan berisi object Pasien dan object seorang dokter yang berasal dari program Project 4. Berikan pelengkap konstruktur dan accessor methods yang masuk akal pada class dan sebuah metode yang sama seperti sebelumnya. Pertama-tama tulis program driver untuk menguji semua method anda, kemudian tulis sebuah program yang membuat setidaknya terdiri dari 2 pasien, 2 doktor dan setidaknya 2 pembayaran dan kemudian tampilkan total pemasukkan ataupendapatan dari pembayaran.

SCRIPT CODE JAVA

MAIN CLASS



Billing Class


Doctor Class


Patient Class


Person Class



Output

KELOMPOK 5 SI-40-02

1. Aulia Nuri Ikhsanati (1202160002)

2. Aprilia Ari Widyastuti (1202160098)

3. Naufal Al Hakim (1202164399)

4. Yohanes Alfandi (1202160381)


Leave a Reply