-
Notifications
You must be signed in to change notification settings - Fork 0
/
Guest.cpp
44 lines (39 loc) · 1001 Bytes
/
Guest.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
#include <iostream>
#include "Guest.h"
#include "Library.h"
#include "Book.h"
#include "Collection.h"
using namespace std;
Guest::Guest()
{
id = rand();
}
Member* Guest::registering()
{
string userName, passWord, phone, fullname;
cout << "Enter a username: ";
cin >> userName;
cout << "Enter a password: ";
cin >> passWord;
cout << "Enter your full name: ";
cin.ignore();
getline(cin, fullname);
cout << "Enter your phone number: ";
cin >> phone;
Member* newUser = new Member(userName, passWord, phone, fullname);
newUser->addUserName(userName);
newUser->addPass(passWord);
cout << "Congratulation " << newUser->getFullName() << ", you have registered successfully" << endl;
return newUser;
}
void Guest::read(Book* b)
{
cout << "You are reading " << b->getFreePage() << " free pages of " << b->getTitle() << " book" << endl;
}
int Guest::getId()
{
return id;
}
Guest::~Guest()
{
}