Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please assist with writing this code given the listed instructions 1. Design the class patient Type, inherited from class persontype, with additional data members to

please assist with writing this code given the listed instructions image text in transcribed
image text in transcribed
image text in transcribed
1. Design the class patient Type, inherited from class persontype, with additional data members to store a patient's ID, age, date of birth, the date the patient was admitted in the hospital, and the date the patient was discharged. The data members must be private. 2. Add appropriate constructors and member functions to initialize, access and manipulate data members. 3. Code a test program that creates a new patient. Test the classes as follows: Create a patient Type object. Request the patient ID, First Name, Last Name Set the values in the object appropriately The date of birth, admission date and discharge dates may be set using hard-coded values or requested. Set these values for the patient Type object Print the patient Type object information: First Name, Last Name, Admission Date, Discharge Date, Date of birth Complete as much as you can before you leave ensuring what you've completed compiles. These labs are entirely for your practice. The program may be named any name of our choice and must have a .cpp extention; variables may be any name of your choice. You DO NOT have to comment these programs. 1 / Author: D.s. Malik // class person Type // This class specifies the members to implement a person's // first name and last name. //***** ****** #ifndef _personType #define H_personType #include using namespace std; class personType public: void print() const; //Function to output the first name and last name //in the form first Name lastName. void setName(string first, string last); //Function to set first Name and lastName according //to the parameters. //Postcondition: firstName - first; lastName - last string getFirstName() const; //Function to return the first name. //Postcondition: The value of the data member firstName is returned. string getLastName() const; //Function to return the last name. // Postcondition: The value of the data member lastName is returned. // personType(string first- , string last // constructor //Sets firstName and lastName according to the parameters. / /The default values of the parameters are empty strings. //Postcondition: firstName = first; lastName - last private: string firstName; //variable to store the first name string lastName; //variable to store the last name #endit // Author: D.S. Malik // // Implementation file personType Imp.cpp // This file contains the definitions of the functions to // implement the operations of the class personType. //************ #include #include #include "personType.h" using namespace std; void personType: :print() const cout

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

Database Systems For Advanced Applications 17th International Conference Dasfaa 2012 Busan South Korea April 2012 Proceedings Part 1 Lncs 7238

Authors: Sang-goo Lee ,Zhiyong Peng ,Xiaofang Zhou ,Yang-Sae Moon ,Rainer Unland ,Jaesoo Yoo

2012 Edition

364229037X, 978-3642290374

More Books

Students also viewed these Databases questions

Question

600 lb 20 0.5 ft 30 30 5 ft

Answered: 1 week ago