2024-08-19 02:35:16 +03:00
|
|
|
#include "goods.h"
|
|
|
|
#include <string>
|
|
|
|
|
2024-08-20 02:38:40 +03:00
|
|
|
Goods::Goods(std::string name, double price_per_unit, double quantity) {
|
2024-08-19 02:35:16 +03:00
|
|
|
this->name = name;
|
|
|
|
this->price_per_unit = price_per_unit;
|
2024-08-20 02:38:40 +03:00
|
|
|
this->quantity = quantity;
|
2024-08-19 02:35:16 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
double Goods::calculate_total_price() {
|
|
|
|
return this->price_per_unit * this->quantity;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string Goods::get_name() { return this->name; }
|
|
|
|
|
|
|
|
double Goods::get_quantity() { return this->quantity; }
|
|
|
|
|
|
|
|
double Goods::get_price_per_unit() { return this->price_per_unit; }
|
|
|
|
|
|
|
|
void Goods::set_name(std::string name) { this->name = name; }
|
|
|
|
|
|
|
|
void Goods::set_quantity(double quantity) { this->quantity = quantity; }
|
|
|
|
|
|
|
|
void Goods::set_price_per_unit(double price_per_unit) {
|
|
|
|
this->price_per_unit = price_per_unit;
|
|
|
|
}
|