-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCustomer.cpp
More file actions
34 lines (26 loc) · 1.07 KB
/
Customer.cpp
File metadata and controls
34 lines (26 loc) · 1.07 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
// Blake Berry
// 03/08/2022
// Homework 4
// This file is an implimentation for the Customer class. The Customer class
// represents a store customer and has an associated name and customer number
// the customer is hashable
//-----------------------------------------------------------------------------
#include "Customer.h"
//-------------------------- Constructor -----------------------------------
// Creates a customer given a number and a string name.
// Preconditions : It is assumed that the customer number is 3 digits
// Postconditions: A customer is created with a given customer number
// and a given customer name
Customer::Customer(int customerNumber, std::string customerName) :
HashableObject(std::to_string(customerNumber)),
customerNumber_(customerNumber),
customerName_(customerName)
{
}
//-------------------------- getName -----------------------------------
// Returns the name associated with the customer
// Postconditions: returns the name associated with the customer
std::string Customer::getName() const
{
return customerName_;
}