forked from ODAVING/BTP305
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCustomerItem.cpp
53 lines (45 loc) · 935 Bytes
/
CustomerItem.cpp
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
//Sina Lahsaee
//129948162
#include "CustomerItem.h"
#include "Item.h"
#include <iomanip>
using namespace std;
CustomerItem::CustomerItem(const std::string &m_tempstr)
{
filled = false;
code = 0;
name = m_tempstr;
}
bool CustomerItem::asksFor(const Item &item) const
{
return false;
}
bool CustomerItem::isFilled() const
{
return filled;
}
void CustomerItem::fill(const unsigned int c)
{
code = c;
filled = true;
}
void CustomerItem::clear()
{
code = 0;
filled = false;
}
const std::string & CustomerItem::getName() const
{
return name;// TODO: insert return statement here
}
void CustomerItem::display(std::ostream &os) const
{
if (filled == true)
{
os << "+" << " [" <<right << setw(CODE_WIDTH) << setfill('0') << code << setfill(' ') << "] " <<name << endl;
}
else if (filled == false)
{
os << "-" << " [" << right << setw(CODE_WIDTH) << setfill('0') << code << setfill(' ') << "] " << name << endl;
}
}