Untitled
unknown
plain_text
2 years ago
732 B
9
Indexable
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;
Editor is loading...
Leave a Comment