#include <iostream>
#include <map>

class ReportCard
{
   //private:  this is the default anyway for a class
   public: //made to be able to print the internals below.
        std::map<std::string, double> m_report_card;

   public:


        /* this returns an instance of the std::map. The map is copied and 
        returned, so any modifications will not affect m_report_card
        std::map<std::string, double> getReportCardInstance()
        {
            return m_report_card;
        }

        if you want to do this, return std::map<std::string, double>&.
        std::map<std::string, double>& getReportCardInstance()
        {
            return m_report_card;
        }
        */

        // better solution is to have a method to add the report

        void add_report(const std::string& first,double second)
        {
            m_report_card[first] = second;
        }  

};


int main() {
    ReportCard rc;
    rc.add_report("Percy",1.0);
    rc.add_report("Pig",2.0);

    for(auto internal_report_card : rc.m_report_card)
    {
        std::cout << internal_report_card.first << ", " 
                  << internal_report_card.second << std::endl;
    }

    return 0;
}