I want the book price object (Bprice) has its value accordding to the marker object. When the marker is equal to "blue" on price, green another.
I think this is possible, I don't know how !
I thought this code be solved with this
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
void Book::setBPrice(int Bprice)
{
//bPrice_= bPrice;
if (isMarkerBlue(marker_))
Bprice_ = 10;
else
Bprice_= 5;
}
bool Book::isMarkerBlue(string const &marker)
{
string str1 = "blue";
if (str1.compare(marker) == 0)
cout << "the marker is blue" << "\n";
returntrue;
}