DEBUG Exercise 1. // This file defines the Patient class used by // a doctor's office. The Patient class has two // overloaded constructors -- a default constructor, // and one that requires an ID number and full name. // A demonstration program declares two Patient objects. class Patient Declarations private string idNum private string lastName private string firstName private Patient() idNum = "0000" lastName = "XXXX" firstName = "XXXX" return public Patient(num id, string last, string first) this.id = id lastName = last firstName = first return public string display() output "Patient #", idNum, lastName, firstName return endClass start Declarations Patient patient1 Patient patient2("234", "Lee", "Lydia") patient1.display() patient2.display() stop
DEBUG Exercise 1.
// This file defines the Patient class used by
// a doctor's office. The Patient class has two
// overloaded constructors -- a default constructor,
// and one that requires an ID number and full name.
// A demonstration program declares two Patient objects.
class Patient
Declarations
private string idNum
private string lastName
private string firstName
private Patient()
idNum = "0000"
lastName = "XXXX"
firstName = "XXXX"
return
public Patient(num id, string last, string first)
this.id = id
lastName = last
firstName = first
return
public string display()
output "Patient #", idNum, lastName, firstName
return
endClass
start
Declarations
Patient patient1
Patient patient2("234", "Lee", "Lydia")
patient1.display()
patient2.display()
stop
DEBUG Exercise 2
Trending now
This is a popular solution!
Step by step
Solved in 3 steps