-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.cpp
42 lines (37 loc) · 1.36 KB
/
main.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
/**
*cpp file of assignment 3 main
*Authors Alexey Titov and Shir Bentabou
*Version 1.0
**/
//libraries
#include <iostream>
#include "Member.h"
using namespace std;
Member avi, beni, chana;
void test1() {
Member dana;
chana.follow(dana);
dana.follow(avi);
cout << " " << chana.numFollowers() << " " << chana.numFollowing() << endl; // 0 1
cout << " " << avi.numFollowers() << " " << avi.numFollowing() << endl; // 1 0
cout << " " << Member::count() << endl; // 4
}
int main() {
cout << avi.numFollowers() << " " << avi.numFollowing() << endl; // 0 0
avi.follow(beni);
cout << avi.numFollowers() << " " << avi.numFollowing() << endl; // 0 1
cout << beni.numFollowers() << " " << beni.numFollowing() << endl; // 1 0
cout << Member::count() << endl; // 3
cout << endl;
avi.follow(avi); //user wants to follow himself
avi.follow(beni); // duplicate follow has no effect
cout << avi.numFollowers() << " " << avi.numFollowing() << endl; // 0 1
avi.unfollow(beni);
cout << avi.numFollowers() << " " << avi.numFollowing() << endl; // 0 0
cout << endl;
cout << chana.numFollowers() << " " << chana.numFollowing() << endl; // 0 0
test1();
cout << chana.numFollowers() << " " << chana.numFollowing() << endl; // 0 0
cout << avi.numFollowers() << " " << avi.numFollowing() << endl; // 0 0
cout << Member::count() << endl; // 3
}