From fa1dc0d19a530be717ba6df3f5c939a640405fed Mon Sep 17 00:00:00 2001 From: Holger Boerchers Date: Sun, 23 Dec 2018 11:31:16 +0100 Subject: [PATCH] created customer, reservation and address --- src/Motorradvermietung.cpp | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/src/Motorradvermietung.cpp b/src/Motorradvermietung.cpp index 026bd3e..c255cf1 100644 --- a/src/Motorradvermietung.cpp +++ b/src/Motorradvermietung.cpp @@ -19,6 +19,17 @@ public: } }; +class reservation final +{ +private: + tm start_ = {}; + tm end_ = {}; + short motorcycle_ = -1; // => nothing reserved + string customer_name_; + string costumer_first_name_; +public: +}; + class customer final { private: @@ -28,7 +39,6 @@ private: unsigned short year_of_birth_ = 1900; string phone_no_; bool has_driving_license_ = false; - short reserved_motorcycle_ = -1; // => nothing reserved public: customer(string&& name, string&& first_name,address&& address, unsigned short&& year_of_birth, string&& phone_no, bool&& has_driving_license) : name_(name), first_name_(first_name), @@ -41,6 +51,27 @@ public: } }; +/** + * \brief ask a question and get a answer. + * \tparam T return parameter + * \param question the question. + * \return the value. + */ +template +T ask_question(const string& question) +{ + cout << question << endl; + cout << "> "; + T value; + cin >> value; + return value; +} + +void create_customer(); +void create_reservation(); +void take_reservation(); +void export_reservations(); + int main() { std::cout << "Hello World!\n";