diff options
| author | Fuwn <[email protected]> | 2023-09-26 22:43:48 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-09-26 22:43:48 -0700 |
| commit | 61adbbcab7abf608925c8ceeb26b4261fed99961 (patch) | |
| tree | 385a432cc9aaf500c7d64f5de786ba130a4c4fe6 /week_1/review_program/textbook.cpp | |
| parent | style(review_program): implement styles (diff) | |
| download | cs260-61adbbcab7abf608925c8ceeb26b4261fed99961.tar.xz cs260-61adbbcab7abf608925c8ceeb26b4261fed99961.zip | |
docs(review_program): comments
Diffstat (limited to 'week_1/review_program/textbook.cpp')
| -rw-r--r-- | week_1/review_program/textbook.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/week_1/review_program/textbook.cpp b/week_1/review_program/textbook.cpp index eff0e92..09a43bd 100644 --- a/week_1/review_program/textbook.cpp +++ b/week_1/review_program/textbook.cpp @@ -20,7 +20,7 @@ uint64_t Textbook::GetNumberOnHand() const { return this->number_on_hand_; } uint64_t Textbook::GetProspectiveEnrollment() const { return this->prospective_enrollment_; -} +} // uint64_t Textbook::GetProspectiveEnrollment() const bool Textbook::GetIsRequired() const { return this->is_required_; } @@ -35,15 +35,15 @@ void Textbook::SetCode(uint64_t code) { this->code_ = code; } void Textbook::SetSingleCopyPrice(double single_copy_price) { this->single_copy_price_ = single_copy_price; -} +} // void Textbook::SetSingleCopyPrice(double single_copy_price) void Textbook::SetNumberOnHand(uint64_t number_on_hand) { this->number_on_hand_ = number_on_hand; -} +} // void Textbook::SetNumberOnHand(uint64_t number_on_hand) void Textbook::SetProspectiveEnrollment(uint64_t prospective_enrollment) { this->prospective_enrollment_ = prospective_enrollment; -} +} // void Textbook::SetProspectiveEnrollment(uint64_t prospective_enrollment) void Textbook::SetIsRequired(bool required) { this->is_required_ = required; } @@ -58,14 +58,14 @@ void Textbook::Print() const { << "\nEnrollment: " << this->prospective_enrollment_ << "\nRequired: " << (this->is_required_ ? "Yes" : "No") << "\nUsed: " << (this->_is_used ? "Yes" : "No") << std::endl; -} +} // void Textbook::Print() const void Textbook::PrintNeeds() const { // Pretty print the amount to order and total cost std::cout << "Need to order: " << this->amount_to_order_ << "\nTotal cost: $" << std::fixed << std::setprecision(2) << this->total_cost_ << std::endl; -} +} // void Textbook::PrintNeeds() const // Evaluators void Textbook::EvaluateNeeds() { @@ -95,15 +95,15 @@ void Textbook::EvaluateNeeds() { static_cast<double>(this->amount_to_order_) * this->single_copy_price_; this->total_cost_ = total_cost; -} +} // void Textbook::EvaluateNeeds() // Operator overloads bool Textbook::operator==(const Textbook &other) const { return this->code_ == other.code_; -} +} // bool Textbook::operator==(const Textbook &other) const bool Textbook::operator!=(const Textbook &other) const { return this->code_ != other.code_; -} +} // bool Textbook::operator!=(const Textbook &other) const } // namespace wk1_reviewProgram_zSzabatin |