/*
 * exampleStep2Constructors.cpp
 * 
 * Author: Deborah R. Fowler
 * Date: Oct 19, 2019
 * 
 * Simple example to show the new function for creating objects
 */


#include <iostream>
using namespace std;

class Muppet
{
    public:
        int energy;
        void talk();
        Muppet();
};

// The constructor is a special function that is called automatically when an instance is created
// Commonly used for initalizing value for the data
Muppet::Muppet()
{
    cout << "\nA muppet has been born!";
    energy = 20;
}

void Muppet::talk()
{
    // NOTE that in the member functions or methods I can use the data that is part of the class
    cout << "\nHello, I'm a muppet with energy level " << energy;
};

int main()
{
        Muppet kermit;
        kermit.talk();
}

