-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTwoDayPackage.cpp
More file actions
27 lines (24 loc) · 893 Bytes
/
TwoDayPackage.cpp
File metadata and controls
27 lines (24 loc) · 893 Bytes
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
#include "TwoDayPackage.h"
TwoDayPackage::TwoDayPackage
(const std::string& _sName, const std::string& _sAddress, const std::string& _sCity, const std::string& _sProvince, const std::string& _sPostalCode, // sender
const std::string& _rName, const std::string& _rAddress, const std::string& _rCity, const std::string& _rProvince, const std::string& _rPostalCode, // recipient
double _weight, double _costPerKilo, double _flatFee)
: Package(_sName, _sAddress, _sCity, _sProvince, _sPostalCode,
_rName, _rAddress, _rCity, _rProvince, _rPostalCode,
_weight, _costPerKilo)
{
setFlatFee(_flatFee);
}
void TwoDayPackage::setFlatFee(double f)
{
if (f < 0.0) { flatFee = 0.0; }
flatFee = f;
}
double TwoDayPackage::getFlatFee() const
{
return flatFee;
}
double TwoDayPackage::calculateCost() const
{
return Package::calculateCost() + getFlatFee();
}