The OrderRecord Class
Now, we'll examine the class which converts CSV lines to records.
We'll cover the following...
The main class that is used to compute results is OrderRecord
. It’s a direct representation of a line from a CSV file.
Press + to interact
class OrderRecord{public:// constructors...double CalcRecordPrice() const noexcept;bool CheckDate(const Date& start, const Date& end) const noexcept;private:Date mDate;std::string mCouponCode;double mUnitPrice{ 0.0 };double mDiscount{ 0.0 }; // 0... 1.0unsigned int mQuantity{ 0 };};
The conversion
Once we ...