Working on first option
This commit is contained in:
		| @@ -1,6 +1,9 @@ | |||||||
| #include "pch.h" | #include "pch.h" | ||||||
| #include <iostream> | #include <iostream> | ||||||
| #include <ctime> | #include <ctime> | ||||||
|  | #include <vector> | ||||||
|  | #include <list> | ||||||
|  | #include <string> | ||||||
|  |  | ||||||
| using namespace  std; | using namespace  std; | ||||||
|  |  | ||||||
| @@ -8,14 +11,88 @@ class Employee | |||||||
| { | { | ||||||
| private: | private: | ||||||
| public: | public: | ||||||
|  | 	Employee(string a_name, string a_first_name, int day, int month, int year) : name(a_name), first_name(a_first_name) | ||||||
|  | 	{ | ||||||
|  | 		day_of_birth.tm_mday = day; | ||||||
|  | 		day_of_birth.tm_mon = month - 1; | ||||||
|  | 		day_of_birth.tm_year = year - 1900; | ||||||
|  |  | ||||||
|  | 	} | ||||||
| 	string name; | 	string name; | ||||||
| 	string first_name; | 	string first_name; | ||||||
| 	tm day_of_birth; | 	tm day_of_birth; | ||||||
| 	int holidays; | 	int holidays; | ||||||
|  | 	int taken_holidays; | ||||||
|  |  | ||||||
|  |  | ||||||
| }; | }; | ||||||
|  |  | ||||||
|  | static list<Employee> employees; | ||||||
|  |  | ||||||
|  | void CreateEmployee(); | ||||||
|  |  | ||||||
| int main() | int main() | ||||||
| { | { | ||||||
|     cout << "Hello World!\n";  | 	bool end_program = false; | ||||||
|  | 	while (!end_program) | ||||||
|  | 	{ | ||||||
|  | 		int input = 1; | ||||||
|  | 		system("cls"); | ||||||
|  | 		cout << "Urlaubsverwaltung" << endl << endl; | ||||||
|  | 		cout << "Bitte w<>hlen Sie eine Option:" << endl; | ||||||
|  | 		cout << "1: Mitarbeiter anlegen" << endl; | ||||||
|  | 		cout << "2: Mitarbeiter l<>schen" << endl; | ||||||
|  | 		cout << "3: Urlaub eingeben" << endl; | ||||||
|  | 		cout << "4: Mitarbeiter suchen" << endl; | ||||||
|  | 		cout << "5: Alle Mitarbeiter auflisten" << endl; | ||||||
|  | 		cout << "0: Programm beenden" << endl; | ||||||
|  | 		cin >> input; | ||||||
|  |  | ||||||
|  | 		switch (input) | ||||||
|  | 		{ | ||||||
|  | 		case 1: | ||||||
|  | 			CreateEmployee(); | ||||||
|  | 			break; | ||||||
|  | 		case 2: | ||||||
|  | 			break; | ||||||
|  | 		case 3: | ||||||
|  | 			break; | ||||||
|  | 		case 4: | ||||||
|  | 			break; | ||||||
|  | 		case 5: | ||||||
|  | 			break; | ||||||
|  | 		case 0: | ||||||
|  | 			end_program = true; | ||||||
|  | 			break; | ||||||
|  | 		default: | ||||||
|  | 			cout << "Unerlaubte Eingabe" << endl; | ||||||
|  |  | ||||||
|  | 		} | ||||||
|  | 	} | ||||||
|  | } | ||||||
|  |  | ||||||
|  | void CreateEmployee() | ||||||
|  | { | ||||||
|  | 	string name; | ||||||
|  | 	string first_name; | ||||||
|  | 	cout << "Bitte einen Namen eingeben: "; | ||||||
|  | 	cin >> name; | ||||||
|  | 	cout << endl; | ||||||
|  | 	cout << "Bitte einen Vornamen eingeben: "; | ||||||
|  | 	cin >> first_name; | ||||||
|  | 	cout << endl; | ||||||
|  | 	cout << "Bitte das Geburtsdatum eingeben: " << endl; | ||||||
|  | 	int day; | ||||||
|  | 	cout << "Tag: "; | ||||||
|  | 	cin >> day; | ||||||
|  | 	int month; | ||||||
|  | 	cout << "Monat: "; | ||||||
|  | 	cin >> month; | ||||||
|  | 	int year; | ||||||
|  | 	cout << "Jahr: "; | ||||||
|  | 	cin >> year; | ||||||
|  |  | ||||||
|  | 	Employee em = Employee(name, first_name, day, month, year); | ||||||
|  |  | ||||||
|  | 	//employees.push_back() | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user