-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathWeddingGuest.h
64 lines (48 loc) · 2 KB
/
WeddingGuest.h
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#ifndef WG_H
#define WG_H
#include <string>
using namespace std;
//#include <iostream>
typedef std::string GuestType;
class WeddingGuest {
private:
struct Node {
std::string firstName;
std::string lastName;
GuestType value;
Node* next;
Node* prev;
};
Node* head;
void sortedInsert(std::string firstName, std::string lastName, GuestType value);
bool isGuestOnList(std::string firstName, std::string lastName) const;
void deleteNode(std::string firstName, std::string lastName, GuestType value);
void insertToBack(std::string firstName, std::string lastName, GuestType value);
void printList() const;
public:
WeddingGuest();
bool noGuests() const;
int guestCount() const;
bool inviteGuest(const std::string& firstName,
const std::string& lastName, const GuestType& value);
bool alterGuest(const std::string& firstName, const std::string& lastName,
const GuestType& value);
bool inviteOrAlter(const std::string& firstName,
const std::string& lastName, const GuestType& value);
bool crossGuestOff(const std::string& firstName, const std::string& lastName);
bool invitedToTheWedding(const std::string& firstName,
const std::string& lastName) const;
bool matchInvitedGuest(const std::string& firstName, const std::string& lastName,
GuestType& value) const;
bool verifyGuestOnTheList(int i, std::string& firstName, std::string& lastName,
GuestType& value) const;
void swapWeddingGuests(WeddingGuest& other);
~WeddingGuest();
WeddingGuest(const WeddingGuest& rhs);
const WeddingGuest& operator= (const WeddingGuest& rhs);
};
#endif
bool joinGuests(const WeddingGuest& odOne, const WeddingGuest& odTwo,
WeddingGuest& joinedList);
void attestGuests(const std::string& fsearch, const std::string& lsearch,
const WeddingGuest& odOne, WeddingGuest& odResult);