SlideShare a Scribd company logo
1 of 2
Download to read offline
In C++:
15.4:
=====
Define a base class called Person. The class should have two data members
to hold the first name and last name of a person, both of type string. The
Person class will have a default constructor to initialize both data members
to empty strings, a constructor to accept two string parameters and use them
to initialize the first and last name, and a copy constructor. Also include
appropriate accessor and mutator member functions. Overload the operators ==
and != such that two objects of class Person are considered equal if and only
if both first and last names are equal. Also overload operators >>, <<, and =.
Define a class called Doctor derived from the Person class. The class
should have a data member to hold the doctor's hourly rate (of type double), a
default constructor to initialize the rate to 0, and a constructor that takes
a double and a reference to an object of type Person and initializes the data
members to their appropriate values. Also include an accessor and mutator
member functions for the doctor's hourly rate. In Doctor class, redefine the
operator = such that it not only copies the first and last name, but also
copies the hourly rate.
Define another class called Patient derived from the Person class. This
class should have a data member to hold the patient's primary physician (of
class Doctor). Include a default constructor that would call the default
constructors of class Doctor and Person to initialize the object; also include
a constructor that accepts a reference to an object of class Doctor and Person
and initializes the Patient object's data members to their respective values.
Add accessor and mutator member functions to access or set the primary
physician.
Finally, define a class called Billing that would hold information about
medical bills. This class should have the following data members: an object of
type Doctor to hold the doctor to whom the money is paid, an object of type
Patient to hold the patient who pays the money, and a variable of type double
to hold the amount due. The Billing class will have a default constructor that
initializes amount due to 0.0 and calls the default constructors for Patient
and Doctor objects and a constructor that accepts references to Doctor and
Patient objects and the amount of hours (type int). The latter constructor
will calculate the amount due in the following fashion:
* if the doctor involved in the bill is the patient's primary physician,
then the amount due is hours multiplied by the doctor's hourly rate;
* if the doctor involved is not the patient's primary physician, then
the amount due is hours times doctor's hourly rate times 1.25.
Write a main function that would prompt the user to enter the patient's
name, their primary physician's name and rate, another doctor's name and rate,
and the amount of hours spent in the doctor's office. Then the program will
calculate and output the amount patient owes for doctor's services.
Note: two doctors are considered the same if and only if their names match
(i.e. you can assume no doctors with the same name and different rates exist).

More Related Content

Similar to In C++ 154 Define a base class called Person The .pdf

C0 review core java1
C0 review core java1C0 review core java1
C0 review core java1
tam53pm1
 
Uml diagram for_hospital_management_system
Uml diagram for_hospital_management_systemUml diagram for_hospital_management_system
Uml diagram for_hospital_management_system
Pradeep Bhosale
 
CIS 25 SPRING 2020FINAL Due 1159 PM May 22 (this is a har.docx
CIS 25 SPRING 2020FINAL Due 1159 PM May 22 (this is a har.docxCIS 25 SPRING 2020FINAL Due 1159 PM May 22 (this is a har.docx
CIS 25 SPRING 2020FINAL Due 1159 PM May 22 (this is a har.docx
sleeperharwell
 
CIS336 Lab 2 The Expanded Entity Relationship DiagramLAB OVERVI.docx
CIS336 Lab 2 The Expanded Entity Relationship DiagramLAB OVERVI.docxCIS336 Lab 2 The Expanded Entity Relationship DiagramLAB OVERVI.docx
CIS336 Lab 2 The Expanded Entity Relationship DiagramLAB OVERVI.docx
clarebernice
 
Conway Regional Hospital has recently hired you to help them.pdf
Conway Regional Hospital has recently hired you to help them.pdfConway Regional Hospital has recently hired you to help them.pdf
Conway Regional Hospital has recently hired you to help them.pdf
abhijitakolkar1
 
ENTD311_CASE2Community Patient Portal System Part 1.pdfCP.docx
ENTD311_CASE2Community Patient Portal System Part 1.pdfCP.docxENTD311_CASE2Community Patient Portal System Part 1.pdfCP.docx
ENTD311_CASE2Community Patient Portal System Part 1.pdfCP.docx
SALU18
 
Anatomy & Physiology I C15FD-BSC2085CExam #4 Final Study Gui.docx
Anatomy & Physiology I   C15FD-BSC2085CExam #4 Final Study Gui.docxAnatomy & Physiology I   C15FD-BSC2085CExam #4 Final Study Gui.docx
Anatomy & Physiology I C15FD-BSC2085CExam #4 Final Study Gui.docx
rossskuddershamus
 
A small medical clinic needs a relational database for its medical pra (1).pdf
A small medical clinic needs a relational database for its medical pra (1).pdfA small medical clinic needs a relational database for its medical pra (1).pdf
A small medical clinic needs a relational database for its medical pra (1).pdf
fprancky
 
Define a class named Doctor whose objects are records for clinic’s d.pdf
Define a class named Doctor whose objects are records for clinic’s d.pdfDefine a class named Doctor whose objects are records for clinic’s d.pdf
Define a class named Doctor whose objects are records for clinic’s d.pdf
MALASADHNANI
 
Ssis First Project Word7
Ssis First Project Word7Ssis First Project Word7
Ssis First Project Word7
jolisadillard
 
New Perspectives Access 2013 Tutorial 3 SAM Project 1a.docx
New Perspectives Access 2013 Tutorial 3 SAM Project 1a.docxNew Perspectives Access 2013 Tutorial 3 SAM Project 1a.docx
New Perspectives Access 2013 Tutorial 3 SAM Project 1a.docx
henrymartin15260
 
CPPS Part 2 Page 1 Community Patient Portal System (CPP.docx
CPPS Part 2 Page 1  Community Patient Portal System (CPP.docxCPPS Part 2 Page 1  Community Patient Portal System (CPP.docx
CPPS Part 2 Page 1 Community Patient Portal System (CPP.docx
vanesaburnand
 

Similar to In C++ 154 Define a base class called Person The .pdf (19)

C0 review core java1
C0 review core java1C0 review core java1
C0 review core java1
 
Umldiagramforhospitalmanagementsystem 140425070951-phpapp02
Umldiagramforhospitalmanagementsystem 140425070951-phpapp02Umldiagramforhospitalmanagementsystem 140425070951-phpapp02
Umldiagramforhospitalmanagementsystem 140425070951-phpapp02
 
Uml diagram for_hospital_management_system
Uml diagram for_hospital_management_systemUml diagram for_hospital_management_system
Uml diagram for_hospital_management_system
 
CIS 25 SPRING 2020FINAL Due 1159 PM May 22 (this is a har.docx
CIS 25 SPRING 2020FINAL Due 1159 PM May 22 (this is a har.docxCIS 25 SPRING 2020FINAL Due 1159 PM May 22 (this is a har.docx
CIS 25 SPRING 2020FINAL Due 1159 PM May 22 (this is a har.docx
 
CIS336 Lab 2 The Expanded Entity Relationship DiagramLAB OVERVI.docx
CIS336 Lab 2 The Expanded Entity Relationship DiagramLAB OVERVI.docxCIS336 Lab 2 The Expanded Entity Relationship DiagramLAB OVERVI.docx
CIS336 Lab 2 The Expanded Entity Relationship DiagramLAB OVERVI.docx
 
Conway Regional Hospital has recently hired you to help them.pdf
Conway Regional Hospital has recently hired you to help them.pdfConway Regional Hospital has recently hired you to help them.pdf
Conway Regional Hospital has recently hired you to help them.pdf
 
ENTD311_CASE2Community Patient Portal System Part 1.pdfCP.docx
ENTD311_CASE2Community Patient Portal System Part 1.pdfCP.docxENTD311_CASE2Community Patient Portal System Part 1.pdfCP.docx
ENTD311_CASE2Community Patient Portal System Part 1.pdfCP.docx
 
Anatomy & Physiology I C15FD-BSC2085CExam #4 Final Study Gui.docx
Anatomy & Physiology I   C15FD-BSC2085CExam #4 Final Study Gui.docxAnatomy & Physiology I   C15FD-BSC2085CExam #4 Final Study Gui.docx
Anatomy & Physiology I C15FD-BSC2085CExam #4 Final Study Gui.docx
 
ERD.pdf
ERD.pdfERD.pdf
ERD.pdf
 
A small medical clinic needs a relational database for its medical pra (1).pdf
A small medical clinic needs a relational database for its medical pra (1).pdfA small medical clinic needs a relational database for its medical pra (1).pdf
A small medical clinic needs a relational database for its medical pra (1).pdf
 
Clinic Management System
Clinic Management SystemClinic Management System
Clinic Management System
 
A practical introduction to SADI semantic Web services and HYDRA query tool
A practical introduction to SADI semantic Web services and HYDRA query toolA practical introduction to SADI semantic Web services and HYDRA query tool
A practical introduction to SADI semantic Web services and HYDRA query tool
 
Object Oriented PHP - PART-1
Object Oriented PHP - PART-1Object Oriented PHP - PART-1
Object Oriented PHP - PART-1
 
Define a class named Doctor whose objects are records for clinic’s d.pdf
Define a class named Doctor whose objects are records for clinic’s d.pdfDefine a class named Doctor whose objects are records for clinic’s d.pdf
Define a class named Doctor whose objects are records for clinic’s d.pdf
 
Ssis First Project Word7
Ssis First Project Word7Ssis First Project Word7
Ssis First Project Word7
 
New Perspectives Access 2013 Tutorial 3 SAM Project 1a.docx
New Perspectives Access 2013 Tutorial 3 SAM Project 1a.docxNew Perspectives Access 2013 Tutorial 3 SAM Project 1a.docx
New Perspectives Access 2013 Tutorial 3 SAM Project 1a.docx
 
CPPS Part 2 Page 1 Community Patient Portal System (CPP.docx
CPPS Part 2 Page 1  Community Patient Portal System (CPP.docxCPPS Part 2 Page 1  Community Patient Portal System (CPP.docx
CPPS Part 2 Page 1 Community Patient Portal System (CPP.docx
 
Operator overloading
Operator overloadingOperator overloading
Operator overloading
 
Beit 381 se lec 19 - 18 - 12 apr24 - eraa and data modeling
Beit 381 se lec 19 - 18 - 12 apr24 - eraa and data modelingBeit 381 se lec 19 - 18 - 12 apr24 - eraa and data modeling
Beit 381 se lec 19 - 18 - 12 apr24 - eraa and data modeling
 

More from aayushmaany2k14

7 You have just discovered a new fungal species from Yellow.pdf
7 You have just discovered a new fungal species from Yellow.pdf7 You have just discovered a new fungal species from Yellow.pdf
7 You have just discovered a new fungal species from Yellow.pdf
aayushmaany2k14
 
7 Using terms from the key on the right correctly identify.pdf
7 Using terms from the key on the right correctly identify.pdf7 Using terms from the key on the right correctly identify.pdf
7 Using terms from the key on the right correctly identify.pdf
aayushmaany2k14
 

More from aayushmaany2k14 (20)

7 In pea plants round R is dominant to wrinkled r A h.pdf
7 In pea plants round R is dominant to wrinkled r A h.pdf7 In pea plants round R is dominant to wrinkled r A h.pdf
7 In pea plants round R is dominant to wrinkled r A h.pdf
 
7 In cats some are black some are orange and some are ca.pdf
7 In cats some are black some are orange and some are ca.pdf7 In cats some are black some are orange and some are ca.pdf
7 In cats some are black some are orange and some are ca.pdf
 
7 You have just discovered a new fungal species from Yellow.pdf
7 You have just discovered a new fungal species from Yellow.pdf7 You have just discovered a new fungal species from Yellow.pdf
7 You have just discovered a new fungal species from Yellow.pdf
 
7 Write the MIPS code to implement the for loop below Use .pdf
7 Write the MIPS code to implement the for loop below Use .pdf7 Write the MIPS code to implement the for loop below Use .pdf
7 Write the MIPS code to implement the for loop below Use .pdf
 
7 Given the diagram above describe the order of events in .pdf
7 Given the diagram above describe the order of events in .pdf7 Given the diagram above describe the order of events in .pdf
7 Given the diagram above describe the order of events in .pdf
 
7 Ontario Resources a natural energy supplier borrowed 8.pdf
7 Ontario Resources a natural energy supplier borrowed 8.pdf7 Ontario Resources a natural energy supplier borrowed 8.pdf
7 Ontario Resources a natural energy supplier borrowed 8.pdf
 
7 Let XiiZ+1i2path dM263681c0701839752119c34.pdf
7 Let XiiZ+1i2path dM263681c0701839752119c34.pdf7 Let XiiZ+1i2path dM263681c0701839752119c34.pdf
7 Let XiiZ+1i2path dM263681c0701839752119c34.pdf
 
7 Essay What is the difference between efficiency and equ.pdf
7 Essay What is the difference between efficiency and equ.pdf7 Essay What is the difference between efficiency and equ.pdf
7 Essay What is the difference between efficiency and equ.pdf
 
7 What is most true about the following B2B promotional too.pdf
7 What is most true about the following B2B promotional too.pdf7 What is most true about the following B2B promotional too.pdf
7 What is most true about the following B2B promotional too.pdf
 
7 What do foxes and birds have in common a They are both .pdf
7 What do foxes and birds have in common a They are both .pdf7 What do foxes and birds have in common a They are both .pdf
7 What do foxes and birds have in common a They are both .pdf
 
7 Using terms from the key on the right correctly identify.pdf
7 Using terms from the key on the right correctly identify.pdf7 Using terms from the key on the right correctly identify.pdf
7 Using terms from the key on the right correctly identify.pdf
 
7 Using node 1 as the root perform a BFS for node 6 Detai.pdf
7 Using node 1 as the root perform a BFS for node 6 Detai.pdf7 Using node 1 as the root perform a BFS for node 6 Detai.pdf
7 Using node 1 as the root perform a BFS for node 6 Detai.pdf
 
8 The residents of Elk Meadows and Valley View are experien.pdf
8 The residents of Elk Meadows and Valley View are experien.pdf8 The residents of Elk Meadows and Valley View are experien.pdf
8 The residents of Elk Meadows and Valley View are experien.pdf
 
8 What would be the most possible interaction between the s.pdf
8 What would be the most possible interaction between the s.pdf8 What would be the most possible interaction between the s.pdf
8 What would be the most possible interaction between the s.pdf
 
8 A unique structure in vertebrate embryos is the somite S.pdf
8 A unique structure in vertebrate embryos is the somite S.pdf8 A unique structure in vertebrate embryos is the somite S.pdf
8 A unique structure in vertebrate embryos is the somite S.pdf
 
7 Kate has a utility function Uxy4xpath dM95702c.pdf
7 Kate has a utility function Uxy4xpath dM95702c.pdf7 Kate has a utility function Uxy4xpath dM95702c.pdf
7 Kate has a utility function Uxy4xpath dM95702c.pdf
 
8 Protein synthesis begins when in the nucleus of each cell.pdf
8 Protein synthesis begins when in the nucleus of each cell.pdf8 Protein synthesis begins when in the nucleus of each cell.pdf
8 Protein synthesis begins when in the nucleus of each cell.pdf
 
729 David is going to purchase two stocks to form the initi.pdf
729 David is going to purchase two stocks to form the initi.pdf729 David is going to purchase two stocks to form the initi.pdf
729 David is going to purchase two stocks to form the initi.pdf
 
8 IPOsinitial public offerings of stockcreate billions of.pdf
8 IPOsinitial public offerings of stockcreate billions of.pdf8 IPOsinitial public offerings of stockcreate billions of.pdf
8 IPOsinitial public offerings of stockcreate billions of.pdf
 
8 Agreement and disagreement among economists Suppose that .pdf
8 Agreement and disagreement among economists Suppose that .pdf8 Agreement and disagreement among economists Suppose that .pdf
8 Agreement and disagreement among economists Suppose that .pdf
 

Recently uploaded

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 

Recently uploaded (20)

microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Magic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptxMagic bus Group work1and 2 (Team 3).pptx
Magic bus Group work1and 2 (Team 3).pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 

In C++ 154 Define a base class called Person The .pdf

  • 1. In C++: 15.4: ===== Define a base class called Person. The class should have two data members to hold the first name and last name of a person, both of type string. The Person class will have a default constructor to initialize both data members to empty strings, a constructor to accept two string parameters and use them to initialize the first and last name, and a copy constructor. Also include appropriate accessor and mutator member functions. Overload the operators == and != such that two objects of class Person are considered equal if and only if both first and last names are equal. Also overload operators >>, <<, and =. Define a class called Doctor derived from the Person class. The class should have a data member to hold the doctor's hourly rate (of type double), a default constructor to initialize the rate to 0, and a constructor that takes a double and a reference to an object of type Person and initializes the data members to their appropriate values. Also include an accessor and mutator member functions for the doctor's hourly rate. In Doctor class, redefine the operator = such that it not only copies the first and last name, but also copies the hourly rate. Define another class called Patient derived from the Person class. This class should have a data member to hold the patient's primary physician (of class Doctor). Include a default constructor that would call the default constructors of class Doctor and Person to initialize the object; also include a constructor that accepts a reference to an object of class Doctor and Person and initializes the Patient object's data members to their respective values. Add accessor and mutator member functions to access or set the primary physician. Finally, define a class called Billing that would hold information about medical bills. This class should have the following data members: an object of type Doctor to hold the doctor to whom the money is paid, an object of type Patient to hold the patient who pays the money, and a variable of type double to hold the amount due. The Billing class will have a default constructor that initializes amount due to 0.0 and calls the default constructors for Patient and Doctor objects and a constructor that accepts references to Doctor and Patient objects and the amount of hours (type int). The latter constructor will calculate the amount due in the following fashion: * if the doctor involved in the bill is the patient's primary physician, then the amount due is hours multiplied by the doctor's hourly rate; * if the doctor involved is not the patient's primary physician, then
  • 2. the amount due is hours times doctor's hourly rate times 1.25. Write a main function that would prompt the user to enter the patient's name, their primary physician's name and rate, another doctor's name and rate, and the amount of hours spent in the doctor's office. Then the program will calculate and output the amount patient owes for doctor's services. Note: two doctors are considered the same if and only if their names match (i.e. you can assume no doctors with the same name and different rates exist).