#define XERR
#include "costs.ih"

void Costs::setProportion(bool lungCancer)
{
    // d_base = { "Costs:", "Discount:", "???" }

    d_base.back() = "proportion:";
    LineInfo const *lineInfo = Parser::one(d_base).get();

    istringstream in{ lineInfo->tail };            // get the line's tail

    in >> d_discountProportion;
    if (lungCancer)
        in >> d_discountProportion;

    if (not in or not Globals::proportion(d_discountProportion))
        Err::range();
}
