Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

continued from: http://www.chegg.com/homework-help/java-introduction-to-problem-solving-and-programming-6th-edition-chapter-8-problem-5pp-solution-9780132162708?trackid=2893f3af&strackid=481e6a3f&ii=4 Define a class Person that holds person's name and appropriate constructors, get/set methods, display and hasSameName methods. hasSameName method will return true

continued from: http://www.chegg.com/homework-help/java-introduction-to-problem-solving-and-programming-6th-edition-chapter-8-problem-5pp-solution-9780132162708?trackid=2893f3af&strackid=481e6a3f&ii=4

"Define a class Person that holds person's name and appropriate constructors, get/set methods, display and hasSameName methods. hasSameName method will return true if two objects of data type Person have the same name. Then define a class named Doctor whose objects are records for a clinic's doctors. Drive this class from the class Person. A Doctor record has doctor's name, a specialty, and office visit fee. Give your class a reasonable complement of constructors and get/set methods, and an equals method as well. The equals method returns true if two doctor records are the same. Name this class BillingRecordDemo. Drive Patient form the class Person. A patient record has the Patient's name, and an identification number. A Billing object will contain a Patient object and a Doctor object. Give your class a reasonable complement of constructors, get/set methods, display and an equals method."

*Problem starts here**. new output:

19.25 Billing Record with Exception

A possible output may look like the following:

Enter number of doctors in the facility: 2

Enter number of patients in the facility: 5

-----------------------------

Create Doctor Array:

-----------------------------

Doctor 1

Enter doctor's name: Garry Allen

Enter Specialty: Family Medicine

Enter office visit fee: 180.65

Doctor 2

Enter doctor's name: Sarah Adler

Enter Specialty: Cardiology

Enter office visit fee: 540.98

-----------------------------

Create Patient Array:

-----------------------------

Patient 0

Enter Patient's name: Bruce Ammar

Enter Patient ID: 1234

Patient 1

Enter Patient's name: Mike Anderson

Enter Patient ID: 2345

Patient 2

Enter Patient's name: Jenna Baily

Enter Patient ID: 5678

Patient 3

Enter Patient's name: Mark Kapur

Enter Patient ID: 6789

Patient 4

Enter Patient's name: Lilian Snyder

Enter Patient ID: 7890

Enter Patient index: 0

Enter Doctor index: 0

Do you want to set another appointment? (y/n)y

Enter Patient index: 0

Enter Doctor index: 1

Do you want to set another appointment? (y/n)y

Enter Patient index: 3

Enter Doctor index: 0

Do you want to set another appointment? (y/n)y

Enter Patient index: 4

Enter Doctor index: 1

Do you want to set another appointment? (y/n)y

Enter Patient index: 2

Enter Doctor index: 0

Do you want to set another appointment? (y/n)y

Enter Patient index: 1

Enter Doctor index: 1

Do you want to set another appointment? (y/n)n

Name Garry Allen

Specialty Family Medicine

Office Visit Fee $180.65

Total Income $541.95

------------------------------------

Name Sarah Adler

Specialty Cardiology

Office Visit Fee $540.98

Total Income $1622.94

------------------------------------

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

continued from:...

Answered: 1 week ago

Question

Evaluate employees readiness for training. page 275

Answered: 1 week ago