Untitled

mail@pastecode.io avatar
unknown
plain_text
7 months ago
732 B
1
Indexable
Never
import java.util.Date;

public class Inpatient {
    // Define the fields for the Inpatient class
    private String name;
    private int age;
    private int hospitalNumber;
    private Date dateOfAdmission;
    private double roomRent;

    // Define a constructor for the Inpatient class
    public Inpatient(String name, int age, int hospitalNumber, Date dateOfAdmission, double roomRent) {
        this.name = name;
        this.age = age;
        this.hospitalNumber = hospitalNumber;
        this.dateOfAdmission = dateOfAdmission;
        this.roomRent = roomRent;
    }

    // Define getter methods for each field
    public String getName() {
        return name;
    }

    public int getAge() {
        return age;
   
Leave a Comment