// Attached: HW_8s-2b
// ===========================================================
// File: HW_8s_2b_Combined.cpp
// ===========================================================
// Programmer: Elaine Torrez
// Class: CMPR 121
// ===========================================================

#include <iostream>
#include <string>
using namespace std;

// ===========================================================
// Date Class
// ===========================================================
class Date
{
private:
    int month;
    int day;
    int year;

public:
    Date()
    {
        month = 0;
        day = 0;
        year = 0;
    }

    Date(int m, int d, int y)
    {
        month = m;
        day = d;
        year = y;
    }

    ~Date()
    {
    }

    void setDate(int m, int d, int y)
    {
        month = m;
        day = d;
        year = y;
    }

    void displayDate()
    {
        cout << month << "/" << day << "/" << year;
    }
};

// ===========================================================
// FamousPeople Class
// ===========================================================
class FamousPeople
{
private:
    string name;
    string quote;
    Date birthdate;

public:
    FamousPeople()
    {
        name = "";
        quote = "";
    }

    ~FamousPeople()
    {
    }

    void setName(string n)
    {
        name = n;
    }

    void setQuote(string q)
    {
        quote = q;
    }

    void setDate(int m, int d, int y)
    {
        birthdate.setDate(m, d, y);
    }

    void displayDate()
    {
        birthdate.displayDate();
    }

    void displayPerson()
    {
        cout << "Name: " << name << endl;
        cout << "Birth Date: ";
        displayDate();
        cout << endl;
        cout << "Enter the quotation:" << endl;
        cout << "\"" << quote << "\"" << endl << endl;
    }
};

// ===========================================================
// Main Function
// ===========================================================
int main()
{
    FamousPeople person1, person2, person3;

    string name, quote;
    int month, day, year;

    // First Person
    cout << "Enter the first famous person: ";
    getline(cin, name);
    person1.setName(name);

    cout << endl;
    cout << "Enter the quotation:" << endl;
    getline(cin, quote);
    person1.setQuote(quote);

    cout << endl;
    cout << "Enter the birthdate:" << endl;
    cout << "Month: ";
    cin >> month;
    cout << "Day: ";
    cin >> day;
    cout << "Year: ";
    cin >> year;
    person1.setDate(month, day, year);

    cin.ignore();

    cout << endl << "----  (Screen Clears)  ----" << endl << endl;

    // Second Person
    cout << "Enter the second famous person: ";
    getline(cin, name);
    person2.setName(name);

    cout << endl;
    cout << "Enter the quotation:" << endl;
    getline(cin, quote);
    person2.setQuote(quote);

    cout << endl;
    cout << "Enter the birthdate:" << endl;
    cout << "Month: ";
    cin >> month;
    cout << "Day: ";
    cin >> day;
    cout << "Year: ";
    cin >> year;
    person2.setDate(month, day, year);

    cin.ignore();

    cout << endl << "----  (Screen Clears)  ----" << endl << endl;

    // Third Person
    cout << "Enter the third famous person: ";
    getline(cin, name);
    person3.setName(name);

    cout << endl;
    cout << "Enter the quotation:" << endl;
    getline(cin, quote);
    person3.setQuote(quote);

    cout << endl;
    cout << "Enter the birthdate:" << endl;
    cout << "Month: ";
    cin >> month;
    cout << "Day: ";
    cin >> day;
    cout << "Year: ";
    cin >> year;
    person3.setDate(month, day, year);

    cout << endl << "----  (Screen Clears)  ----" << endl;
    cout << "Here are the famous people:" << endl << endl;

    person1.displayPerson();
    person2.displayPerson();
    person3.displayPerson();

    system("pause");
    return 0;
}