SlideShare a Scribd company logo
1 of 17
Download to read offline
struct procedure
{
Date dateOfProcedure;
int procedureID;
int procedureProviderID;
};
Data.h
#include
#include
class Date
{
friend ostream& operator<<( ostream &, const Date & );
// allows easy output to a ostream
public:
Date( int m = 1, int d = 1, int y = 1900 ); // constructor, note the default values
void setDate( int, int, int ); // set the date const
Date &operator+=( int ); // add days, modify object
bool leapYear( int) const; // is this a leap year?
bool endOfMonth( int ) const; // is this end of month?
int getMonth ( ) const;
int getDay ( ) const;
int getYear ( ) const;
string getMonthString( ) const;
private:
int month;
int day;
int year;
static const int days[]; // array of days per month static const string monthName[]; // array of
month names
void helpIncrement();
// utility function
}; #endif Data.cpp // Member function definitions for Date
class in separate
date.cpp
#include
#include "date.h"
#include // Initialize static members at file scope; // one class-wide copy.
const int Date::days[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; const string
Date::monthName[] = { "January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December" };
// Date constructor
Date::Date(int m, int d, int y)
{
setDate(m, d, y); } // Set the date
void Date::setDate(int mm, int dd, int yy)
{
month = (mm >= 1 && mm <= 12) ? mm : 1; year = (yy >=1900&& yy <= 2100) ? yy
: 1900; // test for a leap year
if (month == 2 && leapYear(year)) day = (dd >= 1 && dd <= 29) ? dd : 1;
else
day =(dd >= 1 && dd <= days[month]) ? dd : 1;
} // Add a specific number of days to a date
const Date &Date::operator+=(int additionalDays)
{
for (int i = 0; i < additionalDays; i++) helpIncrement();
return *this; // enables cascading
} // If the year is leap year, return true; //
otherwise, return false
bool Date::leapYear(int testYear)
const
{
if (testYear % 400 == 0 || (testYear %100 != 0 && testYear % 4 == 0)) return true; // a
leap year
else
return false; // not a leap year
} // Determine if the day is the end of the month
bool Date::endOfMonth(int testDay)
const
{
if (month == 2 && leapYear(year))
return (testDay == 29); // last day of Feb. in leap year
else
return (testDay == days[month]);
} // Function to help increment the date
void Date::helpIncrement()
{
if (!endOfMonth(day))
{
// date is not at the end of the month
day++;
}
else if (month < 12)
{
// date is at the end of the month, but month < 12 day = 1; ++month;
}
else
{
// end of month and year: last day of the year
day = 1;
month = 1;
++year;
} }
// Overloaded output operator
ostream &operator<<(ostream& output, const Date &d)
{
output << d.monthName[d.month] << ' ' << d.day << ", "<< d.year;
return output; // enables cascading
}
int Date::getMonth() const //
{
Public:
int month[20];
If(month[]!=”/0”)
Cout<<”Enter Month :-<>month;
Elseif (month[]<12)
{
Cout<>month[];
else
return month;
}
int Date::getDay() const //
{
Public :
int day[20];
if(day[]!=”/0”)
{
cout<<”Enter day :”<>day[];
}
Else if(day>31)
{
Cout<>day[];
}
else
return day;
}
int Date::getYear() const //
{
Public :
int year[1000];
If(year[]!=”/0”)
{
Cout<<”Enter year:”<>year[];
Else
{
return year;
}
string Date::getMonthString() const//
{
Public:
String monthname[20];
if(monthname[]!=”/0”)
{
Cout<>monthname[];
}
Else
return monthName[month];
}
patient.h
#pragma once
#include
#include
#include "date.h" /*#ifndef PATIENT1_H #define PATIENT1_H */
class Patient
{
struct procedure
{
Date dateOfProcedure; int procedureID;
int procedureProviderID;
};
public:
Patient(const char * id=0, const char * first="null", const char * last="null", Date
birth=1900, int doctor=0);
//Put in default values just as in Date class //Use the set functions so input values are
checked
~Patient();
Patient & setID(); //check if length of name string is < 32. // if not, shorten to 32 letters.
Patient & setFirstName(const char * first); //check if length of name string is < // 15, if not,
shorten to 14 letters.
Patient & setLastName(const char *last); //check if length of name string is < // 15, if not,
shorten to 14 letters.
Patient& setBirthDate(Date);
Patient & setPrimaryDoctorID(int);
const char * getID();
const char * getFirstName();
const char * getLastName();
Date getBirthDate();
int getPrimaryDoctorID(); // Patient& operator=(Patient other); bool enterProcedure(Date
procedureDate, int procedureID,int procedureProviderID);//tries to add a new entry to record
array, returns //true if added, false if cannot be added
void printAllProcedures();
void display();
private:
char ID[33];
char firstName[15];
char lastName[15];
Date birthdate;
int primaryDoctorID;
procedure record[100];
int currentCountOfProcedures; // keeps track of how many procedures have //been recorded. if it
reaches 500, no new procedures can //be entered.
};
patient.cpp
#include "Patient.h"
#include
#include
Patient::Patient(const char* , const char * first, const char * last, Date birth, int doctor)
{
setID(); setFirstName(first); setLastName(last); setBirthDate(birth);
setPrimaryDoctorID(doctor);
}
Patient::~Patient()
{ }
Patient &Patient::setID()
{
char hold[33];
memcpy(hold, getLastName(), 15);
strcat_s(hold, getFirstName());
int birthYear = birthdate.getYear();
char holdYearC[5]; sprintf_s(holdYearC, "%d", birthYear); strcat_s(hold,
holdYearC); memcpy(this->ID, hold, 33);
return(*this);
}
Patient& Patient::setFirstName(const char *first) //check if length of name string is <
{
if (strlen(first) > 15)
strncpy(firstName, first, 14);
else
strcpy(firstName, first); return *this;
} // 15, if not, shorten to 14 letters.
Patient& Patient::setLastName(const char *last) //check if length of name string is <
{
if (strlen(last) > 15)
strncpy(lastName, last, 14);
else
strcpy(lastName, last); return *this;
} // 15, if not, shorten to 14 letters.
Patient &Patient::setBirthDate(Date birth)
{
birthdate = birth; return *this;
}
Patient& Patient::setPrimaryDoctorID(int doctor)
{
primaryDoctorID = doctor; return *this;
}
const char *Patient::getID()
{ return ID; }
const char *Patient::getFirstName()
{ return firstName; }
const char *Patient::getLastName()
{ return lastName; }
Date Patient::getBirthDate()
{ return birthdate; }
int Patient::getPrimaryDoctorID()
{ return primaryDoctorID; }
bool Patient::enterProcedure(Date procedureDate, int procedureID,int
procedureProviderID)//tries to add a new entry to record array, returns //true if added, false if
cannot be added
{
if (currentCountOfProcedures > 100)
{
cout << "Cannot add any more procedure" << endl;
return false;
} else
{
record[currentCountOfProcedures].dateOfProcedure = procedureDate;
record[currentCountOfProcedures].procedureID = procedureID;
record[currentCountOfProcedures].procedureProviderID =
procedureProviderID;
currentCountOfProcedures++;
return true;
} }
void Patient::printAllProcedures()
{
cout << "Procedures of patient" << endl;
for (int i = 0; i < currentCountOfProcedures; i++)
{
cout << "Date of Procedure: " << record[i].dateOfProcedure << endl;
cout << "Procedure ID: " << record[i].procedureID << endl;
cout<< "Procedure Provider ID: " << record[i].procedureProviderID
<< endl;
}
Void Patient::display()
{
Public :
Int Current_date[30];
Cout<>FirstName[];
Cout<>LasrName[];
Cout <>BirthDate[];
Cout <
Solution
struct procedure
{
Date dateOfProcedure;
int procedureID;
int procedureProviderID;
};
Data.h
#include
#include
class Date
{
friend ostream& operator<<( ostream &, const Date & );
// allows easy output to a ostream
public:
Date( int m = 1, int d = 1, int y = 1900 ); // constructor, note the default values
void setDate( int, int, int ); // set the date const
Date &operator+=( int ); // add days, modify object
bool leapYear( int) const; // is this a leap year?
bool endOfMonth( int ) const; // is this end of month?
int getMonth ( ) const;
int getDay ( ) const;
int getYear ( ) const;
string getMonthString( ) const;
private:
int month;
int day;
int year;
static const int days[]; // array of days per month static const string monthName[]; // array of
month names
void helpIncrement();
// utility function
}; #endif Data.cpp // Member function definitions for Date
class in separate
date.cpp
#include
#include "date.h"
#include // Initialize static members at file scope; // one class-wide copy.
const int Date::days[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; const string
Date::monthName[] = { "January", "February", "March", "April", "May", "June",
"July", "August", "September", "October", "November", "December" };
// Date constructor
Date::Date(int m, int d, int y)
{
setDate(m, d, y); } // Set the date
void Date::setDate(int mm, int dd, int yy)
{
month = (mm >= 1 && mm <= 12) ? mm : 1; year = (yy >=1900&& yy <= 2100) ? yy
: 1900; // test for a leap year
if (month == 2 && leapYear(year)) day = (dd >= 1 && dd <= 29) ? dd : 1;
else
day =(dd >= 1 && dd <= days[month]) ? dd : 1;
} // Add a specific number of days to a date
const Date &Date::operator+=(int additionalDays)
{
for (int i = 0; i < additionalDays; i++) helpIncrement();
return *this; // enables cascading
} // If the year is leap year, return true; //
otherwise, return false
bool Date::leapYear(int testYear)
const
{
if (testYear % 400 == 0 || (testYear %100 != 0 && testYear % 4 == 0)) return true; // a
leap year
else
return false; // not a leap year
} // Determine if the day is the end of the month
bool Date::endOfMonth(int testDay)
const
{
if (month == 2 && leapYear(year))
return (testDay == 29); // last day of Feb. in leap year
else
return (testDay == days[month]);
} // Function to help increment the date
void Date::helpIncrement()
{
if (!endOfMonth(day))
{
// date is not at the end of the month
day++;
}
else if (month < 12)
{
// date is at the end of the month, but month < 12 day = 1; ++month;
}
else
{
// end of month and year: last day of the year
day = 1;
month = 1;
++year;
} }
// Overloaded output operator
ostream &operator<<(ostream& output, const Date &d)
{
output << d.monthName[d.month] << ' ' << d.day << ", "<< d.year;
return output; // enables cascading
}
int Date::getMonth() const //
{
Public:
int month[20];
If(month[]!=”/0”)
Cout<<”Enter Month :-<>month;
Elseif (month[]<12)
{
Cout<>month[];
else
return month;
}
int Date::getDay() const //
{
Public :
int day[20];
if(day[]!=”/0”)
{
cout<<”Enter day :”<>day[];
}
Else if(day>31)
{
Cout<>day[];
}
else
return day;
}
int Date::getYear() const //
{
Public :
int year[1000];
If(year[]!=”/0”)
{
Cout<<”Enter year:”<>year[];
Else
{
return year;
}
string Date::getMonthString() const//
{
Public:
String monthname[20];
if(monthname[]!=”/0”)
{
Cout<>monthname[];
}
Else
return monthName[month];
}
patient.h
#pragma once
#include
#include
#include "date.h" /*#ifndef PATIENT1_H #define PATIENT1_H */
class Patient
{
struct procedure
{
Date dateOfProcedure; int procedureID;
int procedureProviderID;
};
public:
Patient(const char * id=0, const char * first="null", const char * last="null", Date
birth=1900, int doctor=0);
//Put in default values just as in Date class //Use the set functions so input values are
checked
~Patient();
Patient & setID(); //check if length of name string is < 32. // if not, shorten to 32 letters.
Patient & setFirstName(const char * first); //check if length of name string is < // 15, if not,
shorten to 14 letters.
Patient & setLastName(const char *last); //check if length of name string is < // 15, if not,
shorten to 14 letters.
Patient& setBirthDate(Date);
Patient & setPrimaryDoctorID(int);
const char * getID();
const char * getFirstName();
const char * getLastName();
Date getBirthDate();
int getPrimaryDoctorID(); // Patient& operator=(Patient other); bool enterProcedure(Date
procedureDate, int procedureID,int procedureProviderID);//tries to add a new entry to record
array, returns //true if added, false if cannot be added
void printAllProcedures();
void display();
private:
char ID[33];
char firstName[15];
char lastName[15];
Date birthdate;
int primaryDoctorID;
procedure record[100];
int currentCountOfProcedures; // keeps track of how many procedures have //been recorded. if it
reaches 500, no new procedures can //be entered.
};
patient.cpp
#include "Patient.h"
#include
#include
Patient::Patient(const char* , const char * first, const char * last, Date birth, int doctor)
{
setID(); setFirstName(first); setLastName(last); setBirthDate(birth);
setPrimaryDoctorID(doctor);
}
Patient::~Patient()
{ }
Patient &Patient::setID()
{
char hold[33];
memcpy(hold, getLastName(), 15);
strcat_s(hold, getFirstName());
int birthYear = birthdate.getYear();
char holdYearC[5]; sprintf_s(holdYearC, "%d", birthYear); strcat_s(hold,
holdYearC); memcpy(this->ID, hold, 33);
return(*this);
}
Patient& Patient::setFirstName(const char *first) //check if length of name string is <
{
if (strlen(first) > 15)
strncpy(firstName, first, 14);
else
strcpy(firstName, first); return *this;
} // 15, if not, shorten to 14 letters.
Patient& Patient::setLastName(const char *last) //check if length of name string is <
{
if (strlen(last) > 15)
strncpy(lastName, last, 14);
else
strcpy(lastName, last); return *this;
} // 15, if not, shorten to 14 letters.
Patient &Patient::setBirthDate(Date birth)
{
birthdate = birth; return *this;
}
Patient& Patient::setPrimaryDoctorID(int doctor)
{
primaryDoctorID = doctor; return *this;
}
const char *Patient::getID()
{ return ID; }
const char *Patient::getFirstName()
{ return firstName; }
const char *Patient::getLastName()
{ return lastName; }
Date Patient::getBirthDate()
{ return birthdate; }
int Patient::getPrimaryDoctorID()
{ return primaryDoctorID; }
bool Patient::enterProcedure(Date procedureDate, int procedureID,int
procedureProviderID)//tries to add a new entry to record array, returns //true if added, false if
cannot be added
{
if (currentCountOfProcedures > 100)
{
cout << "Cannot add any more procedure" << endl;
return false;
} else
{
record[currentCountOfProcedures].dateOfProcedure = procedureDate;
record[currentCountOfProcedures].procedureID = procedureID;
record[currentCountOfProcedures].procedureProviderID =
procedureProviderID;
currentCountOfProcedures++;
return true;
} }
void Patient::printAllProcedures()
{
cout << "Procedures of patient" << endl;
for (int i = 0; i < currentCountOfProcedures; i++)
{
cout << "Date of Procedure: " << record[i].dateOfProcedure << endl;
cout << "Procedure ID: " << record[i].procedureID << endl;
cout<< "Procedure Provider ID: " << record[i].procedureProviderID
<< endl;
}
Void Patient::display()
{
Public :
Int Current_date[30];
Cout<>FirstName[];
Cout<>LasrName[];
Cout <>BirthDate[];
Cout <

More Related Content

Similar to struct procedure {    Date dateOfProcedure;    int procedureID.pdf

#include iostream #include iomanip needed for formatting .docx
#include iostream #include iomanip  needed for formatting .docx#include iostream #include iomanip  needed for formatting .docx
#include iostream #include iomanip needed for formatting .docxajoy21
 
CounterTest.javaimport static org.junit.Assert.;import org.jun.pdf
CounterTest.javaimport static org.junit.Assert.;import org.jun.pdfCounterTest.javaimport static org.junit.Assert.;import org.jun.pdf
CounterTest.javaimport static org.junit.Assert.;import org.jun.pdfdeepua8
 
Please I am posting the fifth time and hoping to get this r.pdf
Please I am posting the fifth time and hoping to get this r.pdfPlease I am posting the fifth time and hoping to get this r.pdf
Please I am posting the fifth time and hoping to get this r.pdfankit11134
 
INTERMIDIATE PROGRAMMINGCMPSC 122LAB 9 INHERITANCE AND POLYMO.docx
INTERMIDIATE PROGRAMMINGCMPSC 122LAB 9 INHERITANCE AND POLYMO.docxINTERMIDIATE PROGRAMMINGCMPSC 122LAB 9 INHERITANCE AND POLYMO.docx
INTERMIDIATE PROGRAMMINGCMPSC 122LAB 9 INHERITANCE AND POLYMO.docxnormanibarber20063
 
Hi,I have implemented increment() method. Please find the below up.pdf
Hi,I have implemented increment() method. Please find the below up.pdfHi,I have implemented increment() method. Please find the below up.pdf
Hi,I have implemented increment() method. Please find the below up.pdfAnkitchhabra28
 
8 arrays and pointers
8  arrays and pointers8  arrays and pointers
8 arrays and pointersMomenMostafa
 
publicclass Date {privatestatic String DATE_SEPARATOR = ;pr.pdf
publicclass Date {privatestatic String DATE_SEPARATOR = ;pr.pdfpublicclass Date {privatestatic String DATE_SEPARATOR = ;pr.pdf
publicclass Date {privatestatic String DATE_SEPARATOR = ;pr.pdfmukhtaransarcloth
 
I Have the following Java program in which converts Date to Words an.pdf
I Have the following Java program in which converts Date to Words an.pdfI Have the following Java program in which converts Date to Words an.pdf
I Have the following Java program in which converts Date to Words an.pdfallystraders
 
#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(c#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(cMoseStaton39
 
#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(c#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(cSilvaGraf83
 
#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(c#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(cSilvaGraf83
 
package reservation; import java.util.; For Scanner Class .pdf
 package reservation; import java.util.; For Scanner Class .pdf package reservation; import java.util.; For Scanner Class .pdf
package reservation; import java.util.; For Scanner Class .pdfanitasahani11
 
#include -iostream- #include -fstream- #include -cctype- #include -cst.docx
#include -iostream- #include -fstream- #include -cctype- #include -cst.docx#include -iostream- #include -fstream- #include -cctype- #include -cst.docx
#include -iostream- #include -fstream- #include -cctype- #include -cst.docxNathanyXJSharpu
 
I keep on get a redefinition error and an undefined error.Customer.pdf
I keep on get a redefinition error and an undefined error.Customer.pdfI keep on get a redefinition error and an undefined error.Customer.pdf
I keep on get a redefinition error and an undefined error.Customer.pdfherminaherman
 
#includeiostream #includefstreamusing namespace std; glo.pdf
#includeiostream #includefstreamusing namespace std; glo.pdf#includeiostream #includefstreamusing namespace std; glo.pdf
#includeiostream #includefstreamusing namespace std; glo.pdfkrram1989
 
I have the following code and I need to know why I am receiving the .pdf
I have the following code and I need to know why I am receiving the .pdfI have the following code and I need to know why I am receiving the .pdf
I have the following code and I need to know why I am receiving the .pdfezzi552
 
Below is my program, I just have some issues when I want to check ou.pdf
Below is my program, I just have some issues when I want to check ou.pdfBelow is my program, I just have some issues when I want to check ou.pdf
Below is my program, I just have some issues when I want to check ou.pdfdhavalbl38
 
Working effectively with legacy code
Working effectively with legacy codeWorking effectively with legacy code
Working effectively with legacy codeShriKant Vashishtha
 

Similar to struct procedure {    Date dateOfProcedure;    int procedureID.pdf (20)

#include iostream #include iomanip needed for formatting .docx
#include iostream #include iomanip  needed for formatting .docx#include iostream #include iomanip  needed for formatting .docx
#include iostream #include iomanip needed for formatting .docx
 
CounterTest.javaimport static org.junit.Assert.;import org.jun.pdf
CounterTest.javaimport static org.junit.Assert.;import org.jun.pdfCounterTest.javaimport static org.junit.Assert.;import org.jun.pdf
CounterTest.javaimport static org.junit.Assert.;import org.jun.pdf
 
Please I am posting the fifth time and hoping to get this r.pdf
Please I am posting the fifth time and hoping to get this r.pdfPlease I am posting the fifth time and hoping to get this r.pdf
Please I am posting the fifth time and hoping to get this r.pdf
 
Functional C++
Functional C++Functional C++
Functional C++
 
INTERMIDIATE PROGRAMMINGCMPSC 122LAB 9 INHERITANCE AND POLYMO.docx
INTERMIDIATE PROGRAMMINGCMPSC 122LAB 9 INHERITANCE AND POLYMO.docxINTERMIDIATE PROGRAMMINGCMPSC 122LAB 9 INHERITANCE AND POLYMO.docx
INTERMIDIATE PROGRAMMINGCMPSC 122LAB 9 INHERITANCE AND POLYMO.docx
 
Hi,I have implemented increment() method. Please find the below up.pdf
Hi,I have implemented increment() method. Please find the below up.pdfHi,I have implemented increment() method. Please find the below up.pdf
Hi,I have implemented increment() method. Please find the below up.pdf
 
COW
COWCOW
COW
 
8 arrays and pointers
8  arrays and pointers8  arrays and pointers
8 arrays and pointers
 
publicclass Date {privatestatic String DATE_SEPARATOR = ;pr.pdf
publicclass Date {privatestatic String DATE_SEPARATOR = ;pr.pdfpublicclass Date {privatestatic String DATE_SEPARATOR = ;pr.pdf
publicclass Date {privatestatic String DATE_SEPARATOR = ;pr.pdf
 
I Have the following Java program in which converts Date to Words an.pdf
I Have the following Java program in which converts Date to Words an.pdfI Have the following Java program in which converts Date to Words an.pdf
I Have the following Java program in which converts Date to Words an.pdf
 
#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(c#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(c
 
#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(c#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(c
 
#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(c#include Status.hnamespace sdds{StatusStatus(c
#include Status.hnamespace sdds{StatusStatus(c
 
package reservation; import java.util.; For Scanner Class .pdf
 package reservation; import java.util.; For Scanner Class .pdf package reservation; import java.util.; For Scanner Class .pdf
package reservation; import java.util.; For Scanner Class .pdf
 
#include -iostream- #include -fstream- #include -cctype- #include -cst.docx
#include -iostream- #include -fstream- #include -cctype- #include -cst.docx#include -iostream- #include -fstream- #include -cctype- #include -cst.docx
#include -iostream- #include -fstream- #include -cctype- #include -cst.docx
 
I keep on get a redefinition error and an undefined error.Customer.pdf
I keep on get a redefinition error and an undefined error.Customer.pdfI keep on get a redefinition error and an undefined error.Customer.pdf
I keep on get a redefinition error and an undefined error.Customer.pdf
 
#includeiostream #includefstreamusing namespace std; glo.pdf
#includeiostream #includefstreamusing namespace std; glo.pdf#includeiostream #includefstreamusing namespace std; glo.pdf
#includeiostream #includefstreamusing namespace std; glo.pdf
 
I have the following code and I need to know why I am receiving the .pdf
I have the following code and I need to know why I am receiving the .pdfI have the following code and I need to know why I am receiving the .pdf
I have the following code and I need to know why I am receiving the .pdf
 
Below is my program, I just have some issues when I want to check ou.pdf
Below is my program, I just have some issues when I want to check ou.pdfBelow is my program, I just have some issues when I want to check ou.pdf
Below is my program, I just have some issues when I want to check ou.pdf
 
Working effectively with legacy code
Working effectively with legacy codeWorking effectively with legacy code
Working effectively with legacy code
 

More from anonaeon

the reaction between SnCl4 and pyridine conducted.pdf
                     the reaction between SnCl4 and pyridine conducted.pdf                     the reaction between SnCl4 and pyridine conducted.pdf
the reaction between SnCl4 and pyridine conducted.pdfanonaeon
 
The number of mols of HBr initially add to the so.pdf
                     The number of mols of HBr initially add to the so.pdf                     The number of mols of HBr initially add to the so.pdf
The number of mols of HBr initially add to the so.pdfanonaeon
 
One or more hydrogens can be replaced by halogens.pdf
                     One or more hydrogens can be replaced by halogens.pdf                     One or more hydrogens can be replaced by halogens.pdf
One or more hydrogens can be replaced by halogens.pdfanonaeon
 
mass over moles .pdf
                     mass over moles                                  .pdf                     mass over moles                                  .pdf
mass over moles .pdfanonaeon
 
linear This is Because here Double Bonds in a st.pdf
                     linear  This is Because here Double Bonds in a st.pdf                     linear  This is Because here Double Bonds in a st.pdf
linear This is Because here Double Bonds in a st.pdfanonaeon
 
its the same one mole of any element has the same.pdf
                     its the same one mole of any element has the same.pdf                     its the same one mole of any element has the same.pdf
its the same one mole of any element has the same.pdfanonaeon
 
Eugenol, as a phenol, is a weak acid, whereas ace.pdf
                     Eugenol, as a phenol, is a weak acid, whereas ace.pdf                     Eugenol, as a phenol, is a weak acid, whereas ace.pdf
Eugenol, as a phenol, is a weak acid, whereas ace.pdfanonaeon
 
Hg(NO3)2 is completely ionic HgCl2 is partially i.pdf
                     Hg(NO3)2 is completely ionic HgCl2 is partially i.pdf                     Hg(NO3)2 is completely ionic HgCl2 is partially i.pdf
Hg(NO3)2 is completely ionic HgCl2 is partially i.pdfanonaeon
 
y+y=x It is a linear ordinary differential eqn of the Bernouille.pdf
y+y=x It is a linear ordinary differential eqn of the Bernouille.pdfy+y=x It is a linear ordinary differential eqn of the Bernouille.pdf
y+y=x It is a linear ordinary differential eqn of the Bernouille.pdfanonaeon
 
Electrophilic addition - hydrogenation H2 Electro.pdf
                     Electrophilic addition - hydrogenation H2 Electro.pdf                     Electrophilic addition - hydrogenation H2 Electro.pdf
Electrophilic addition - hydrogenation H2 Electro.pdfanonaeon
 
True Since E union Ec is the whole sample space which has probabilit.pdf
True Since E union Ec is the whole sample space which has probabilit.pdfTrue Since E union Ec is the whole sample space which has probabilit.pdf
True Since E union Ec is the whole sample space which has probabilit.pdfanonaeon
 
There are many ethical and legal issues surrounding the US human ser.pdf
There are many ethical and legal issues surrounding the US human ser.pdfThere are many ethical and legal issues surrounding the US human ser.pdf
There are many ethical and legal issues surrounding the US human ser.pdfanonaeon
 
The rituals and ceremony that follows the death of a person in order.pdf
The rituals and ceremony that follows the death of a person in order.pdfThe rituals and ceremony that follows the death of a person in order.pdf
The rituals and ceremony that follows the death of a person in order.pdfanonaeon
 
The primary objectivegoal of this paper is to study the effect of w.pdf
The primary objectivegoal of this paper is to study the effect of w.pdfThe primary objectivegoal of this paper is to study the effect of w.pdf
The primary objectivegoal of this paper is to study the effect of w.pdfanonaeon
 
Symmetry It is the property where parts of things resembles each o.pdf
Symmetry  It is the property where parts of things resembles each o.pdfSymmetry  It is the property where parts of things resembles each o.pdf
Symmetry It is the property where parts of things resembles each o.pdfanonaeon
 
Slide to depict the basic layout of the pages in the website. Usiing.pdf
Slide to depict the basic layout of the pages in the website. Usiing.pdfSlide to depict the basic layout of the pages in the website. Usiing.pdf
Slide to depict the basic layout of the pages in the website. Usiing.pdfanonaeon
 
People who are mentally and emotionally healthy haveSolutionP.pdf
People who are mentally and emotionally healthy haveSolutionP.pdfPeople who are mentally and emotionally healthy haveSolutionP.pdf
People who are mentally and emotionally healthy haveSolutionP.pdfanonaeon
 
Part A-iv) Parietal CellsExplanation - The lining of the stoma.pdf
Part A-iv) Parietal CellsExplanation - The lining of the stoma.pdfPart A-iv) Parietal CellsExplanation - The lining of the stoma.pdf
Part A-iv) Parietal CellsExplanation - The lining of the stoma.pdfanonaeon
 
Microplate capture and detection assay is used to detect the specifi.pdf
Microplate capture and detection assay is used to detect the specifi.pdfMicroplate capture and detection assay is used to detect the specifi.pdf
Microplate capture and detection assay is used to detect the specifi.pdfanonaeon
 
C. Amide - Organic functional group found in Nylo.pdf
                     C. Amide - Organic functional group found in Nylo.pdf                     C. Amide - Organic functional group found in Nylo.pdf
C. Amide - Organic functional group found in Nylo.pdfanonaeon
 

More from anonaeon (20)

the reaction between SnCl4 and pyridine conducted.pdf
                     the reaction between SnCl4 and pyridine conducted.pdf                     the reaction between SnCl4 and pyridine conducted.pdf
the reaction between SnCl4 and pyridine conducted.pdf
 
The number of mols of HBr initially add to the so.pdf
                     The number of mols of HBr initially add to the so.pdf                     The number of mols of HBr initially add to the so.pdf
The number of mols of HBr initially add to the so.pdf
 
One or more hydrogens can be replaced by halogens.pdf
                     One or more hydrogens can be replaced by halogens.pdf                     One or more hydrogens can be replaced by halogens.pdf
One or more hydrogens can be replaced by halogens.pdf
 
mass over moles .pdf
                     mass over moles                                  .pdf                     mass over moles                                  .pdf
mass over moles .pdf
 
linear This is Because here Double Bonds in a st.pdf
                     linear  This is Because here Double Bonds in a st.pdf                     linear  This is Because here Double Bonds in a st.pdf
linear This is Because here Double Bonds in a st.pdf
 
its the same one mole of any element has the same.pdf
                     its the same one mole of any element has the same.pdf                     its the same one mole of any element has the same.pdf
its the same one mole of any element has the same.pdf
 
Eugenol, as a phenol, is a weak acid, whereas ace.pdf
                     Eugenol, as a phenol, is a weak acid, whereas ace.pdf                     Eugenol, as a phenol, is a weak acid, whereas ace.pdf
Eugenol, as a phenol, is a weak acid, whereas ace.pdf
 
Hg(NO3)2 is completely ionic HgCl2 is partially i.pdf
                     Hg(NO3)2 is completely ionic HgCl2 is partially i.pdf                     Hg(NO3)2 is completely ionic HgCl2 is partially i.pdf
Hg(NO3)2 is completely ionic HgCl2 is partially i.pdf
 
y+y=x It is a linear ordinary differential eqn of the Bernouille.pdf
y+y=x It is a linear ordinary differential eqn of the Bernouille.pdfy+y=x It is a linear ordinary differential eqn of the Bernouille.pdf
y+y=x It is a linear ordinary differential eqn of the Bernouille.pdf
 
Electrophilic addition - hydrogenation H2 Electro.pdf
                     Electrophilic addition - hydrogenation H2 Electro.pdf                     Electrophilic addition - hydrogenation H2 Electro.pdf
Electrophilic addition - hydrogenation H2 Electro.pdf
 
True Since E union Ec is the whole sample space which has probabilit.pdf
True Since E union Ec is the whole sample space which has probabilit.pdfTrue Since E union Ec is the whole sample space which has probabilit.pdf
True Since E union Ec is the whole sample space which has probabilit.pdf
 
There are many ethical and legal issues surrounding the US human ser.pdf
There are many ethical and legal issues surrounding the US human ser.pdfThere are many ethical and legal issues surrounding the US human ser.pdf
There are many ethical and legal issues surrounding the US human ser.pdf
 
The rituals and ceremony that follows the death of a person in order.pdf
The rituals and ceremony that follows the death of a person in order.pdfThe rituals and ceremony that follows the death of a person in order.pdf
The rituals and ceremony that follows the death of a person in order.pdf
 
The primary objectivegoal of this paper is to study the effect of w.pdf
The primary objectivegoal of this paper is to study the effect of w.pdfThe primary objectivegoal of this paper is to study the effect of w.pdf
The primary objectivegoal of this paper is to study the effect of w.pdf
 
Symmetry It is the property where parts of things resembles each o.pdf
Symmetry  It is the property where parts of things resembles each o.pdfSymmetry  It is the property where parts of things resembles each o.pdf
Symmetry It is the property where parts of things resembles each o.pdf
 
Slide to depict the basic layout of the pages in the website. Usiing.pdf
Slide to depict the basic layout of the pages in the website. Usiing.pdfSlide to depict the basic layout of the pages in the website. Usiing.pdf
Slide to depict the basic layout of the pages in the website. Usiing.pdf
 
People who are mentally and emotionally healthy haveSolutionP.pdf
People who are mentally and emotionally healthy haveSolutionP.pdfPeople who are mentally and emotionally healthy haveSolutionP.pdf
People who are mentally and emotionally healthy haveSolutionP.pdf
 
Part A-iv) Parietal CellsExplanation - The lining of the stoma.pdf
Part A-iv) Parietal CellsExplanation - The lining of the stoma.pdfPart A-iv) Parietal CellsExplanation - The lining of the stoma.pdf
Part A-iv) Parietal CellsExplanation - The lining of the stoma.pdf
 
Microplate capture and detection assay is used to detect the specifi.pdf
Microplate capture and detection assay is used to detect the specifi.pdfMicroplate capture and detection assay is used to detect the specifi.pdf
Microplate capture and detection assay is used to detect the specifi.pdf
 
C. Amide - Organic functional group found in Nylo.pdf
                     C. Amide - Organic functional group found in Nylo.pdf                     C. Amide - Organic functional group found in Nylo.pdf
C. Amide - Organic functional group found in Nylo.pdf
 

Recently uploaded

This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
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 Delhikauryashika82
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
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 ClassesCeline George
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Shubhangi Sonawane
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
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 . pdfQucHHunhnh
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
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 17Celine George
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 

Recently uploaded (20)

This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
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
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
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
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
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
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
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
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 

struct procedure {    Date dateOfProcedure;    int procedureID.pdf

  • 1. struct procedure { Date dateOfProcedure; int procedureID; int procedureProviderID; }; Data.h #include #include class Date { friend ostream& operator<<( ostream &, const Date & ); // allows easy output to a ostream public: Date( int m = 1, int d = 1, int y = 1900 ); // constructor, note the default values void setDate( int, int, int ); // set the date const Date &operator+=( int ); // add days, modify object bool leapYear( int) const; // is this a leap year? bool endOfMonth( int ) const; // is this end of month? int getMonth ( ) const; int getDay ( ) const; int getYear ( ) const; string getMonthString( ) const; private: int month; int day; int year; static const int days[]; // array of days per month static const string monthName[]; // array of month names void helpIncrement(); // utility function }; #endif Data.cpp // Member function definitions for Date class in separate
  • 2. date.cpp #include #include "date.h" #include // Initialize static members at file scope; // one class-wide copy. const int Date::days[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; const string Date::monthName[] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; // Date constructor Date::Date(int m, int d, int y) { setDate(m, d, y); } // Set the date void Date::setDate(int mm, int dd, int yy) { month = (mm >= 1 && mm <= 12) ? mm : 1; year = (yy >=1900&& yy <= 2100) ? yy : 1900; // test for a leap year if (month == 2 && leapYear(year)) day = (dd >= 1 && dd <= 29) ? dd : 1; else day =(dd >= 1 && dd <= days[month]) ? dd : 1; } // Add a specific number of days to a date const Date &Date::operator+=(int additionalDays) { for (int i = 0; i < additionalDays; i++) helpIncrement(); return *this; // enables cascading } // If the year is leap year, return true; // otherwise, return false bool Date::leapYear(int testYear) const { if (testYear % 400 == 0 || (testYear %100 != 0 && testYear % 4 == 0)) return true; // a leap year else return false; // not a leap year } // Determine if the day is the end of the month bool Date::endOfMonth(int testDay) const {
  • 3. if (month == 2 && leapYear(year)) return (testDay == 29); // last day of Feb. in leap year else return (testDay == days[month]); } // Function to help increment the date void Date::helpIncrement() { if (!endOfMonth(day)) { // date is not at the end of the month day++; } else if (month < 12) { // date is at the end of the month, but month < 12 day = 1; ++month; } else { // end of month and year: last day of the year day = 1; month = 1; ++year; } } // Overloaded output operator ostream &operator<<(ostream& output, const Date &d) { output << d.monthName[d.month] << ' ' << d.day << ", "<< d.year; return output; // enables cascading } int Date::getMonth() const // { Public: int month[20];
  • 4. If(month[]!=”/0”) Cout<<”Enter Month :-<>month; Elseif (month[]<12) { Cout<>month[]; else return month; } int Date::getDay() const // { Public : int day[20]; if(day[]!=”/0”) { cout<<”Enter day :”<>day[]; } Else if(day>31) { Cout<>day[]; } else return day; } int Date::getYear() const // { Public : int year[1000]; If(year[]!=”/0”) { Cout<<”Enter year:”<>year[]; Else { return year; }
  • 5. string Date::getMonthString() const// { Public: String monthname[20]; if(monthname[]!=”/0”) { Cout<>monthname[]; } Else return monthName[month]; } patient.h #pragma once #include #include #include "date.h" /*#ifndef PATIENT1_H #define PATIENT1_H */ class Patient { struct procedure { Date dateOfProcedure; int procedureID; int procedureProviderID; }; public: Patient(const char * id=0, const char * first="null", const char * last="null", Date birth=1900, int doctor=0); //Put in default values just as in Date class //Use the set functions so input values are checked ~Patient(); Patient & setID(); //check if length of name string is < 32. // if not, shorten to 32 letters. Patient & setFirstName(const char * first); //check if length of name string is < // 15, if not, shorten to 14 letters. Patient & setLastName(const char *last); //check if length of name string is < // 15, if not,
  • 6. shorten to 14 letters. Patient& setBirthDate(Date); Patient & setPrimaryDoctorID(int); const char * getID(); const char * getFirstName(); const char * getLastName(); Date getBirthDate(); int getPrimaryDoctorID(); // Patient& operator=(Patient other); bool enterProcedure(Date procedureDate, int procedureID,int procedureProviderID);//tries to add a new entry to record array, returns //true if added, false if cannot be added void printAllProcedures(); void display(); private: char ID[33]; char firstName[15]; char lastName[15]; Date birthdate; int primaryDoctorID; procedure record[100]; int currentCountOfProcedures; // keeps track of how many procedures have //been recorded. if it reaches 500, no new procedures can //be entered. }; patient.cpp #include "Patient.h" #include #include Patient::Patient(const char* , const char * first, const char * last, Date birth, int doctor) { setID(); setFirstName(first); setLastName(last); setBirthDate(birth); setPrimaryDoctorID(doctor); } Patient::~Patient() { } Patient &Patient::setID() {
  • 7. char hold[33]; memcpy(hold, getLastName(), 15); strcat_s(hold, getFirstName()); int birthYear = birthdate.getYear(); char holdYearC[5]; sprintf_s(holdYearC, "%d", birthYear); strcat_s(hold, holdYearC); memcpy(this->ID, hold, 33); return(*this); } Patient& Patient::setFirstName(const char *first) //check if length of name string is < { if (strlen(first) > 15) strncpy(firstName, first, 14); else strcpy(firstName, first); return *this; } // 15, if not, shorten to 14 letters. Patient& Patient::setLastName(const char *last) //check if length of name string is < { if (strlen(last) > 15) strncpy(lastName, last, 14); else strcpy(lastName, last); return *this; } // 15, if not, shorten to 14 letters. Patient &Patient::setBirthDate(Date birth) { birthdate = birth; return *this; } Patient& Patient::setPrimaryDoctorID(int doctor) { primaryDoctorID = doctor; return *this; } const char *Patient::getID() { return ID; } const char *Patient::getFirstName() { return firstName; } const char *Patient::getLastName() { return lastName; }
  • 8. Date Patient::getBirthDate() { return birthdate; } int Patient::getPrimaryDoctorID() { return primaryDoctorID; } bool Patient::enterProcedure(Date procedureDate, int procedureID,int procedureProviderID)//tries to add a new entry to record array, returns //true if added, false if cannot be added { if (currentCountOfProcedures > 100) { cout << "Cannot add any more procedure" << endl; return false; } else { record[currentCountOfProcedures].dateOfProcedure = procedureDate; record[currentCountOfProcedures].procedureID = procedureID; record[currentCountOfProcedures].procedureProviderID = procedureProviderID; currentCountOfProcedures++; return true; } } void Patient::printAllProcedures() { cout << "Procedures of patient" << endl; for (int i = 0; i < currentCountOfProcedures; i++) { cout << "Date of Procedure: " << record[i].dateOfProcedure << endl; cout << "Procedure ID: " << record[i].procedureID << endl; cout<< "Procedure Provider ID: " << record[i].procedureProviderID << endl; } Void Patient::display() { Public : Int Current_date[30]; Cout<>FirstName[];
  • 9. Cout<>LasrName[]; Cout <>BirthDate[]; Cout < Solution struct procedure { Date dateOfProcedure; int procedureID; int procedureProviderID; }; Data.h #include #include class Date { friend ostream& operator<<( ostream &, const Date & ); // allows easy output to a ostream public: Date( int m = 1, int d = 1, int y = 1900 ); // constructor, note the default values void setDate( int, int, int ); // set the date const Date &operator+=( int ); // add days, modify object bool leapYear( int) const; // is this a leap year? bool endOfMonth( int ) const; // is this end of month? int getMonth ( ) const; int getDay ( ) const; int getYear ( ) const; string getMonthString( ) const; private: int month; int day; int year; static const int days[]; // array of days per month static const string monthName[]; // array of month names void helpIncrement();
  • 10. // utility function }; #endif Data.cpp // Member function definitions for Date class in separate date.cpp #include #include "date.h" #include // Initialize static members at file scope; // one class-wide copy. const int Date::days[] = { 0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; const string Date::monthName[] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; // Date constructor Date::Date(int m, int d, int y) { setDate(m, d, y); } // Set the date void Date::setDate(int mm, int dd, int yy) { month = (mm >= 1 && mm <= 12) ? mm : 1; year = (yy >=1900&& yy <= 2100) ? yy : 1900; // test for a leap year if (month == 2 && leapYear(year)) day = (dd >= 1 && dd <= 29) ? dd : 1; else day =(dd >= 1 && dd <= days[month]) ? dd : 1; } // Add a specific number of days to a date const Date &Date::operator+=(int additionalDays) { for (int i = 0; i < additionalDays; i++) helpIncrement(); return *this; // enables cascading } // If the year is leap year, return true; // otherwise, return false bool Date::leapYear(int testYear) const { if (testYear % 400 == 0 || (testYear %100 != 0 && testYear % 4 == 0)) return true; // a leap year else return false; // not a leap year
  • 11. } // Determine if the day is the end of the month bool Date::endOfMonth(int testDay) const { if (month == 2 && leapYear(year)) return (testDay == 29); // last day of Feb. in leap year else return (testDay == days[month]); } // Function to help increment the date void Date::helpIncrement() { if (!endOfMonth(day)) { // date is not at the end of the month day++; } else if (month < 12) { // date is at the end of the month, but month < 12 day = 1; ++month; } else { // end of month and year: last day of the year day = 1; month = 1; ++year; } } // Overloaded output operator ostream &operator<<(ostream& output, const Date &d) { output << d.monthName[d.month] << ' ' << d.day << ", "<< d.year; return output; // enables cascading } int Date::getMonth() const // {
  • 12. Public: int month[20]; If(month[]!=”/0”) Cout<<”Enter Month :-<>month; Elseif (month[]<12) { Cout<>month[]; else return month; } int Date::getDay() const // { Public : int day[20]; if(day[]!=”/0”) { cout<<”Enter day :”<>day[]; } Else if(day>31) { Cout<>day[]; } else return day; } int Date::getYear() const // { Public : int year[1000]; If(year[]!=”/0”) { Cout<<”Enter year:”<>year[];
  • 13. Else { return year; } string Date::getMonthString() const// { Public: String monthname[20]; if(monthname[]!=”/0”) { Cout<>monthname[]; } Else return monthName[month]; } patient.h #pragma once #include #include #include "date.h" /*#ifndef PATIENT1_H #define PATIENT1_H */ class Patient { struct procedure { Date dateOfProcedure; int procedureID; int procedureProviderID; }; public: Patient(const char * id=0, const char * first="null", const char * last="null", Date birth=1900, int doctor=0); //Put in default values just as in Date class //Use the set functions so input values are checked ~Patient();
  • 14. Patient & setID(); //check if length of name string is < 32. // if not, shorten to 32 letters. Patient & setFirstName(const char * first); //check if length of name string is < // 15, if not, shorten to 14 letters. Patient & setLastName(const char *last); //check if length of name string is < // 15, if not, shorten to 14 letters. Patient& setBirthDate(Date); Patient & setPrimaryDoctorID(int); const char * getID(); const char * getFirstName(); const char * getLastName(); Date getBirthDate(); int getPrimaryDoctorID(); // Patient& operator=(Patient other); bool enterProcedure(Date procedureDate, int procedureID,int procedureProviderID);//tries to add a new entry to record array, returns //true if added, false if cannot be added void printAllProcedures(); void display(); private: char ID[33]; char firstName[15]; char lastName[15]; Date birthdate; int primaryDoctorID; procedure record[100]; int currentCountOfProcedures; // keeps track of how many procedures have //been recorded. if it reaches 500, no new procedures can //be entered. }; patient.cpp #include "Patient.h" #include #include Patient::Patient(const char* , const char * first, const char * last, Date birth, int doctor) { setID(); setFirstName(first); setLastName(last); setBirthDate(birth); setPrimaryDoctorID(doctor); }
  • 15. Patient::~Patient() { } Patient &Patient::setID() { char hold[33]; memcpy(hold, getLastName(), 15); strcat_s(hold, getFirstName()); int birthYear = birthdate.getYear(); char holdYearC[5]; sprintf_s(holdYearC, "%d", birthYear); strcat_s(hold, holdYearC); memcpy(this->ID, hold, 33); return(*this); } Patient& Patient::setFirstName(const char *first) //check if length of name string is < { if (strlen(first) > 15) strncpy(firstName, first, 14); else strcpy(firstName, first); return *this; } // 15, if not, shorten to 14 letters. Patient& Patient::setLastName(const char *last) //check if length of name string is < { if (strlen(last) > 15) strncpy(lastName, last, 14); else strcpy(lastName, last); return *this; } // 15, if not, shorten to 14 letters. Patient &Patient::setBirthDate(Date birth) { birthdate = birth; return *this; } Patient& Patient::setPrimaryDoctorID(int doctor) { primaryDoctorID = doctor; return *this; } const char *Patient::getID() { return ID; }
  • 16. const char *Patient::getFirstName() { return firstName; } const char *Patient::getLastName() { return lastName; } Date Patient::getBirthDate() { return birthdate; } int Patient::getPrimaryDoctorID() { return primaryDoctorID; } bool Patient::enterProcedure(Date procedureDate, int procedureID,int procedureProviderID)//tries to add a new entry to record array, returns //true if added, false if cannot be added { if (currentCountOfProcedures > 100) { cout << "Cannot add any more procedure" << endl; return false; } else { record[currentCountOfProcedures].dateOfProcedure = procedureDate; record[currentCountOfProcedures].procedureID = procedureID; record[currentCountOfProcedures].procedureProviderID = procedureProviderID; currentCountOfProcedures++; return true; } } void Patient::printAllProcedures() { cout << "Procedures of patient" << endl; for (int i = 0; i < currentCountOfProcedures; i++) { cout << "Date of Procedure: " << record[i].dateOfProcedure << endl; cout << "Procedure ID: " << record[i].procedureID << endl; cout<< "Procedure Provider ID: " << record[i].procedureProviderID << endl; } Void Patient::display()