Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Billing {
- public static double[] computePaymentAmount(Patient patient, double amount) {
- double[] payments = new double[2];
- HealthInsurancePlan patientInsurancePlan = patient.getInsurancePlan();
- // your logic
- double coverageRate = patientInsurancePlan.getCoverage();
- System.out.println("Coverage rate for patient is : "+coverageRate+"\n");
- payments[0] = coverageRate*amount;
- System.out.println("amount paid by insurance is :"+payments[0]+"\n");
- double discountOffered = patientInsurancePlan.getDiscount();
- System.out.println("discount is :"+discountOffered+"\n");
- double amountPaidByPatient = amount - payments[0] - discountOffered;
- System.out.println("amount paid by patient is :"+amountPaidByPatient+"\n");
- payments[1] = amountPaidByPatient;
- return payments;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement