-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGoods.cpp
More file actions
76 lines (61 loc) · 1.48 KB
/
Copy pathGoods.cpp
File metadata and controls
76 lines (61 loc) · 1.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include <string.h>
#include <iostream>
#include "Goods.h"
namespace STD {
void Goods::setGoodsName(char name[])
{
strcpy_s(m_GoodsName, name);
}
void Goods::setGoodsCompanySeller(char companyseller[])
{
strcpy_s(m_GoodsCompanySeller, companyseller);
}
void Goods::setGoodsDescription(char discription[])
{
strcpy_s(m_GoodsDescription, discription);
}
void Goods::setGoodsWeight(int weight)
{
m_GoodsWeight = weight;
}
char* Goods::getGoodsName()
{
return m_GoodsName;
}
char* Goods::getGoodsCompanySeller()
{
return m_GoodsCompanySeller;
}
char* Goods::getGoodsDescription()
{
return m_GoodsDescription;
}
int Goods::getGoodsWeight()
{
return m_GoodsWeight ;
}
void Goods::showInfo()
{
std::cout << "Name: " << getGoodsName() << std::endl;
std::cout << "Company Seller: " << getGoodsCompanySeller() << std::endl;
std::cout << "Discription: " << getGoodsDescription() << std::endl;
std::cout << "Weight: " << getGoodsWeight() << std::endl;
std::cout << std::endl;
}
Goods::Goods()
{
strcpy_s(m_GoodsName, "No Name");
strcpy_s(m_GoodsCompanySeller, "No Seller");
strcpy_s(m_GoodsDescription, "No Discription");
m_GoodsWeight = 0;
}
Goods::Goods(char GoodsName[], char GoodsCompanySeller[], char GoodsDescription[], int GoodsWeight)
{
strcpy_s(m_GoodsName, GoodsName);
strcpy_s(m_GoodsCompanySeller, GoodsCompanySeller);
strcpy_s(m_GoodsDescription, GoodsDescription);
m_GoodsWeight = GoodsWeight;
}
Goods::~Goods() {
}
}