remove ignored pt.2
This commit is contained in:
20
check/check.cpp
Normal file
20
check/check.cpp
Normal file
@@ -0,0 +1,20 @@
|
||||
#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;
|
||||
}
|
||||
18
check/check.h
Normal file
18
check/check.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#ifndef CHECK_H
|
||||
#define CHECK_H
|
||||
#include "../goods/goods.h"
|
||||
#include <vector>
|
||||
|
||||
class Check {
|
||||
std::vector<Goods> goods;
|
||||
|
||||
public:
|
||||
Check();
|
||||
void add_goods(Goods);
|
||||
|
||||
double calculae_total_price();
|
||||
|
||||
std::vector<Goods> &get_goods();
|
||||
};
|
||||
|
||||
#endif // CHECK_H
|
||||
Reference in New Issue
Block a user