-
Notifications
You must be signed in to change notification settings - Fork 0
/
HotelBuchung.cpp
46 lines (37 loc) · 1.82 KB
/
HotelBuchung.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
//
// Created by Fabian on 04.01.24.
//
#include "HotelBuchung.h"
#include <iostream>
std::unordered_map<std::string, std::string> HotelBuchung::attributeValues{{"Nachname", ""},
{"Vorname", ""},
{"Hotelname", ""},
{"Anreise", ""},
{"Abreise", ""},
{"Zimmertyp", ""}};
HotelBuchung::HotelBuchung(const std::string& nachname, const std::string& vorname, const std::string& hotelName,
Date *anreise, Date *abreise, char zimmerTyp)
: Buchung(nachname, vorname), hotelName(hotelName), anreise(anreise), abreise(abreise), zimmerTyp(zimmerTyp) {}
HotelBuchung::HotelBuchung(const HotelBuchung&) {
anreise = new Date();
abreise = new Date();
}
HotelBuchung::~HotelBuchung() {
delete anreise;
delete abreise;
}
void HotelBuchung::zeigeDetails() const {
std::unordered_map<std::string, std::string> attributeValues = HotelBuchung::attributeValues;
attributeValues["Nachname"] = nachname;
attributeValues["Vorname"] = vorname;
attributeValues["Hotelname"] = hotelName;
attributeValues["Anreise"] = anreise->getContent();
attributeValues["Abreise"] = abreise->getContent();
attributeValues["Zimmertyp"] = zimmerTyp;
std::cout << "Details für Hotelbuchung Nr. " << buchungsNummer << std::endl;
for (const auto& attributeValue: attributeValues)
std::cout << attributeValue.first << ": " << attributeValue.second << std::endl;
}
const std::unordered_map<std::string, std::string>& HotelBuchung::getAttributeValues() {
return attributeValues;
}