From a3900c0419c7f3bb3d47834376b610008d6554cf Mon Sep 17 00:00:00 2001 From: SanJacobs Date: Tue, 12 Jul 2022 03:22:40 +0200 Subject: Workdays split into price segments in constructor --- src/main.cpp | 29 +++++++++++++++++++++++++++-- src/time.cpp | 7 +++++-- src/time.h | 6 +++++- 3 files changed, 37 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/main.cpp b/src/main.cpp index f1dd13f..99e5647 100755 --- a/src/main.cpp +++ b/src/main.cpp @@ -111,12 +111,37 @@ int main(int argc, char* argv[]) std::cout << "Copyright 2022 Sander J. Skjegstad.\n"; std::cout << "This is free software with ABSOLUTELY NO WARRENTY.\n"; std::cout << "It does NOT give financial advice.\n\n"; + + std::cout << "-----\nStep 0: Setting the dayrate\n\n"; + + //int dayrate_input; + //std::cout << "What is your dayrate? "; + //std::cin >> dayrate_input; + const int dayrate = 3338; + std::cout << "Dayrate: " << dayrate << "\n"; + const double hourly_rate = dayrate/7.5; + std::cout << "Hourly rate: " << hourly_rate << "\n\n"; std::cout << "-----\nStep 1: Adding the days\n\n"; - bool not_done = true; - while(not_done) { + while(1) { + std::cout << "Filling in a test-day, and that's it.\n"; + std::cout << "Storing multiple workdays in an efficient way will be figured out later." << std::endl; + + workday test_day({0, 0, 1, 1, 1000}, + {0, 8, 20, 11, 2022}, + {0, 21, 20, 11, 2022}, + {0, 18, 20, 11, 2022}); + + std::cout << "\nCalltime: " << timeprint(test_day.call) << "\n"; + std::cout << "Wraptime: " << timeprint(test_day.wrap) << "\n"; + std::cout << "Planned wrap: " << timeprint(test_day.planned_wrap) << "\n\n"; + + for(int i=0; i