#include "Goods.h"
#include <iostream>
int main()
{
Goods g;
return 0;
}
#pragma once
#include <string>
class Goods
{
std::string name; //название
std::string date; //дата оформления
int price{}; //цена
int amount{}; //количество
int number{}; //номер накладной
public:
Goods()=default;
Goods(
std::string_view name
,std::string_view date
,int price
,int amount
,int number
)
:name(name)
,date(date)
,price(price)
,amount(amount)
,number(number)
{
}
//получить название товара
const std::string& GetName()const{return name;}
//задать название товара
void SetName(std::string_view s){name = s;}
//получить дату оформления
const std::string& GetDate()const{return date;}
//задать дату оформления
void SetDate(std::string_view s){date = s;}
//получить цену товара
int GetPrice()const{return price;}
//задать цену товара
void SetPrice(int p){price = p;}
//получить количество товара
int GetAmount()const{return amount;}
//задать количество товара
void SetAmount(int a){amount = a;}
//получить номер накладной
int GetNumber()const{return number;}
//задать номер накладной
void SetNumber(int n){number = n;}
//получить цену товара в виде строки
std::string ToStringPrice()const{return std::to_string(price);}
//получить общую стоимость
int GetTotalCost()const{return price * amount;}
//получить стоимость заданного числа товара
int GetCost(int n)const{return price * n;}
//количество товара увеличить на заданное число
void AmountIncrease(int n){amount += n;}
//количество товара уменьшить на заданное число
void AmountDecrease(int n){amount -= n;}
};
#include "Goods.h"