21 lines
368 B
C++
21 lines
368 B
C++
|
#include "check.h"
|
||
|
#include "../goods/goods.h"
|
||
|
|
||
|
Check::Check() {}
|
||
|
|
||
|
void Check::add_goods(Goods goods) { this->goods.push_back(goods); }
|
||
|
|
||
|
double Check::calculae_total_price() {
|
||
|
double total = 0.0;
|
||
|
|
||
|
for (Goods g : this->goods) {
|
||
|
total += g.calculate_total_price();
|
||
|
}
|
||
|
|
||
|
return total;
|
||
|
}
|
||
|
|
||
|
std::vector<Goods>& Check::get_goods() {
|
||
|
return goods;
|
||
|
}
|