diff options
| author | Fuwn <[email protected]> | 2023-09-26 22:02:04 -0700 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2023-09-26 22:02:04 -0700 |
| commit | 923316b21dc72bfb68dd2f055c88257e03eb1b25 (patch) | |
| tree | 094f4ac80f1d10550720cfd336f297587560e3f3 | |
| parent | fix(review_program): use style guide (diff) | |
| download | cs260-923316b21dc72bfb68dd2f055c88257e03eb1b25.tar.xz cs260-923316b21dc72bfb68dd2f055c88257e03eb1b25.zip | |
style(review_program): move main function order
| -rw-r--r-- | week_1/review_program/review_program.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/week_1/review_program/review_program.cpp b/week_1/review_program/review_program.cpp index a634076..38fb0f3 100644 --- a/week_1/review_program/review_program.cpp +++ b/week_1/review_program/review_program.cpp @@ -4,24 +4,6 @@ #include <cstdint> #include <iostream> -auto main() -> int { - bool run_again = false; - std::vector<textbook::Textbook> textbooks; - - // Loop until user is done entering textbooks - do { - review_program::textbook_input_loop_handler(textbooks); - - std::cout << "Enter 1 to do another book, 0 to stop. "; - std::cin >> run_again; - } while (run_again); - - // Print full purchase summary - review_program::full_purchase_summary(textbooks); - - return 0; -} - namespace review_program { auto textbook_input(textbook::Textbook &textbook) -> void { // Obtain and set all non-evaluated values for textbook @@ -86,3 +68,21 @@ auto full_purchase_summary(const std::vector<textbook::Textbook> &textbooks) std::cout << "Expected profit: $" << total_for_all_books * 0.2 << std::endl; } } // namespace review_program + +auto main() -> int { + bool run_again = false; + std::vector<textbook::Textbook> textbooks; + + // Loop until user is done entering textbooks + do { + review_program::textbook_input_loop_handler(textbooks); + + std::cout << "Enter 1 to do another book, 0 to stop. "; + std::cin >> run_again; + } while (run_again); + + // Print full purchase summary + review_program::full_purchase_summary(textbooks); + + return 0; +} |