Statische liste der Motorräder erstellt. #2

This commit is contained in:
Holger Boerchers 2018-12-25 13:38:17 +01:00
parent ec13686ef3
commit e57a04aae2

View File

@ -1,6 +1,7 @@
#include <iostream> #include <iostream>
#include <string> #include <string>
#include <list> #include <list>
#include <experimental/filesystem>
using namespace std; using namespace std;
@ -82,7 +83,7 @@ class reservation final
private: private:
tm start_ = {}; tm start_ = {};
tm end_ = {}; tm end_ = {};
short motorcycle_ = -1; // => nothing reserved short motorcycle_ = -1; // => -1 means nothing reserved
string customer_name_; string customer_name_;
string costumer_first_name_; string costumer_first_name_;
public: public:
@ -137,6 +138,14 @@ public:
} }
}; };
string motorcycles[] = {
"Suzuki Bandit",
"Honda TransAlp",
"BMW F 650 GS"
"Kawasaki ZZR1400"
};
int size_of_motorcycles = 4;
void create_customer(); void create_customer();
void create_reservation(); void create_reservation();
@ -148,10 +157,13 @@ list<reservation> reservations;
int main() int main()
{ {
try
{
while (true) while (true)
{ {
system("cls"); system("cls");
cout << "Motorradvermietung (" << reservations.size() << " Reservierungen; " << customers.size() << " Kunden)" cout << "Motorradvermietung (" << reservations.size() << " Reservierungen; " << customers.size() <<
" Kunden)"
<< endl << endl; << endl << endl;
cout << "Bitte w\x84hlen Sie eine Option:" << endl; cout << "Bitte w\x84hlen Sie eine Option:" << endl;
cout << "1: Neuen Kunden anlegen" << endl; cout << "1: Neuen Kunden anlegen" << endl;
@ -183,6 +195,12 @@ int main()
system("pause"); system("pause");
} }
} }
}
catch (...)
{
cout << "Etwas unvorhergesehendes ist passiert. Tut mir leid." << endl;
system("pause");
}
} }
void create_customer() void create_customer()