初始化

This commit is contained in:
2025-09-23 17:17:34 +08:00
parent 4d658dbc1e
commit 3497f17101
46 changed files with 5528 additions and 0 deletions

33
Cosmetic.h Normal file
View File

@@ -0,0 +1,33 @@
#ifndef COSMETIC_H
#define COSMETIC_H
#include <string>
#include <ctime>
class Cosmetic {
public:
Cosmetic(std::string name = "", double price = 0.0, bool type = true, std::string expirationDate = "");
// Getter方法
std::string getName() const;
double getPrice() const;
bool getType() const;
std::string getExpirationDate() const;
// Setter方法
void setName(std::string name);
void setPrice(double price);
void setType(bool type);
// 获取当前时间
static std::string getTime();
// 获取当前时间+days天
static std::string getTimeAdd(int days = 60);
private:
std::string name; // 品牌名称
double price; // 单价
bool type; // 类型true:国产, false:进口)
std::string expirationDate; // 新增过期日期成员
};
#endif // COSMETIC_H