diff options
| author | Fuwn <[email protected]> | 2023-09-26 22:14:57 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-09-26 22:14:57 -0700 |
| commit | 199ec09e5b1ab397acf36c192d1e381a89083be8 (patch) | |
| tree | 29d9f70ca0a963df7f49bb387b290b5675a7d7b7 /week_1/review_program/textbook.h | |
| parent | style(review_program): move main function order (diff) | |
| download | cs260-199ec09e5b1ab397acf36c192d1e381a89083be8.tar.xz cs260-199ec09e5b1ab397acf36c192d1e381a89083be8.zip | |
style(review_program): rename symbols
Diffstat (limited to 'week_1/review_program/textbook.h')
| -rw-r--r-- | week_1/review_program/textbook.h | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/week_1/review_program/textbook.h b/week_1/review_program/textbook.h index 879b11d..525d7c1 100644 --- a/week_1/review_program/textbook.h +++ b/week_1/review_program/textbook.h @@ -2,7 +2,7 @@ #define TEXTBOOK_HH #include <cstdint> -namespace textbook { +namespace Textbook { class Textbook { private: // Input values @@ -10,10 +10,10 @@ private: double _single_copy_price; uint64_t _number_on_hand; uint64_t _prospective_enrollment; - bool _required; - bool _used; + bool _is_required; + bool _is_used; // Fix 6 byte misalignment - const char _padding[6] = {0}; + const char PADDING[6] = {0}; // Evaluated values uint64_t _amount_to_order = {0}; double _total_cost = {0}; @@ -24,39 +24,39 @@ public: uint64_t prospective_enrollment, bool required, bool used) : _code(code), _single_copy_price(single_copy_price), _number_on_hand(number_on_hand), - _prospective_enrollment(prospective_enrollment), _required(required), - _used(used) {} + _prospective_enrollment(prospective_enrollment), _is_required(required), + _is_used(used) {} Textbook() : Textbook(0, 0, 0, 0, false, false) {} // Getters - auto code() const -> uint64_t; - auto single_copy_price() const -> double; - auto number_on_hand() const -> uint64_t; - auto prospective_enrollment() const -> uint64_t; - auto required() const -> bool; - auto used() const -> bool; - auto amount_to_order() const -> uint64_t; - auto total_cost() const -> double; + uint64_t GetCode() const; + double GetSingleCopyPrice() const; + uint64_t GetNumberOnHand() const; + uint64_t GetProspectiveEnrollment() const; + bool GetIsRequired() const; + bool GetIsUsed() const; + uint64_t GetAmountToOrder() const; + double GetTotalCost() const; // Setters - auto set_code(uint64_t) -> void; - auto set_single_copy_price(double) -> void; - auto set_number_on_hand(uint64_t) -> void; - auto set_prospective_enrollment(uint64_t) -> void; - auto set_required(bool) -> void; - auto set_used(bool) -> void; + void SetCode(uint64_t); + void SetSingleCopyPrice(double); + void SetNumberOnHand(uint64_t); + void SetProspectiveEnrollment(uint64_t); + void SetIsRequired(bool); + void SetIsUsed(bool); // Procedures - auto evaluate_needs() -> void; + void EvaluateNeeds(); // Printers - auto print() const -> void; - auto print_needs() const -> void; + void Print() const; + void PrintNeeds() const; // Operator overloads - auto operator==(const Textbook &) const -> bool; - auto operator!=(const Textbook &) const -> bool; + bool operator==(const Textbook &) const; + bool operator!=(const Textbook &) const; }; -} // namespace textbook +} // namespace Textbook #endif |