-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOrder.cpp
More file actions
21 lines (16 loc) · 696 Bytes
/
Order.cpp
File metadata and controls
21 lines (16 loc) · 696 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "Order.h"
//#include "RushStatus.h"
Order::Order() : orderNumber(0), quantity(0), warehouseCost(0.0), customerCost(0.0), rush(STANDARD) {}
Order::Order(int n_order_num, int n_quantity, double n_base_price, RushStatus n_rush) : orderNumber(n_order_num), quantity(n_quantity), warehouseCost(n_base_price), rush(n_rush) {
calculateCustomerCost();
}
// Assume high enum value represent higher priority
bool Order::operator<(const Order& other) const {
return this->rush < other.rush;
}
bool Order::operator<=(const Order& other) const {
return this->rush <= other.rush;
}
void Order::calculateCustomerCost() {
customerCost = warehouseCost + (warehouseCost * RUSH_MARKUPS[rush]);
}