Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ programing, thank you so much. This lab will exercise your understanding of some of the concepts covered in Chapter 11:classes, inheritance1. Design the class

C++ programing, thank you so much.

This lab will exercise your understanding of some of the concepts covered in Chapter 11:classes, inheritance1. Design the class patientType, inherited from class persontype, withadditional 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 andmanipulate data members.3. Code a test program that creates a new patient. Test the classes as follows:Create a patientType object.Request the patient ID, First Name, Last NameSet the values in the object appropriatelyThe date of birth, admission date and discharge dates may be set using hard-coded values or requested.Set these values for the patientType objectPrint the patientType object information:First Name, Last Name, Admission Date, Discharge Date,Date of birthComplete as much as you can before you leave ensuring what you've completed compiles. These labs areentirely for your practice.The program may be named any name of our choice and must have a .cpp extention; variables may be any nameof your choice.You DO NOT have to comment these programs, however, please include your NAME as a comment in ALL code files.SUBMIT the code (*.cpp, *.h) and your project file (for Dev C++ is *.dev, for codeblocks it is *.cbp).All files must be submitted and the program MUST compile and run to get credit. The project files donot contain the code files, so please submit all files.You MAY zip the files and submit the zipped files.Questions will be entertained; solution will be discussed in class. This is a collaborative effort to provide examples and practice for your understanding.

image text in transcribed

image text in transcribed

#ifndef H_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 firstName lastName. void setName(string first, string last); //Function to set firstName 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 first Name; //variable to store the first name string lastName; 1/variable to store the last name }; #endif 11 Author: D.S. Malik 11 // Implementation file personTypeImp.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

Conceptual Database Design An Entity Relationship Approach

Authors: Carol Batini, Stefano Ceri, Shamkant B. Navathe

1st Edition

0805302441, 978-0805302448

More Books

Students also viewed these Databases questions

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago