AutolabJS/AutolabJS

View on GitHub
docs/examples/unit_tests/student_solution/cpp/Buyer.cpp

Summary

Maintainability
Test Coverage
#include "Buyer.hpp"

Buyer::Buyer(int cash)
{
    this->cash=cash;
}

int Buyer::getCash()
{
    return cash;
}

void Buyer::setCash(int cash)
{
    this->cash=cash;
}

void Buyer::buy(Seller x)
{
    if(cash>0)
    {
      if(x.sell()==1)
      {
        cash--;
      }
    }
}