File tree Expand file tree Collapse file tree 11 files changed +305
-249
lines changed Expand file tree Collapse file tree 11 files changed +305
-249
lines changed Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change
1
+ #ifndef GLOBAL_HH
2
+ #define GLOBAL_HH
3
+
4
+ #include < iostream>
5
+ #include < iomanip>
6
+ #include < cstdlib>
7
+ #include < ctime>
8
+ #include < cmath>
9
+ #include < vector>
10
+ #include < string>
11
+ #include < algorithm>
12
+ using namespace std ;
13
+
14
+ #ifdef _WIN32
15
+ #include < windows.h>
16
+ #define color system (" Color 0A" )
17
+ #define clr_here system (" cls" )
18
+ #define pause_here system (" pause" )
19
+ #else
20
+ #include < unistd.h>
21
+ #define color
22
+ #define clr_here system (" clear" )
23
+ #define pause_here cout << " Press enter to continue...\n " , getchar()
24
+ #endif
25
+
26
+ #include " ./participant.hh"
27
+
28
+ void printRoundHeader (int roundNumber);
29
+ void printMainHeader ();
30
+ bool cmp1 (participant a, participant b);
31
+ bool cmp2 (participant a, participant b);
32
+ void showLeaderboard (vector<participant> participants, int numberOfParticipants);
33
+
34
+ #endif // !GLOBAL_HH
Original file line number Diff line number Diff line change
1
+ #ifndef PARTICIPANT_HH
2
+ #define PARTICIPANT_HH
3
+
4
+ #include < iostream>
5
+ #include < iomanip>
6
+ #include < string>
7
+ #include < vector>
8
+ using namespace std ;
9
+
10
+ class participant
11
+ {
12
+ private:
13
+ string name = " " ;
14
+ double totalScore = 0.0 ;
15
+ double maxScore = 0.0 ;
16
+ double averageAccuracy = 0.0 ;
17
+ double averageSpeed = 0.0 ; // characters per second
18
+
19
+ public:
20
+ participant (int n);
21
+ void addScore (double score);
22
+ void addAccuracy (double accuracy);
23
+ void addSpeed (double speed);
24
+ string getName ();
25
+ double getTotalScore ();
26
+ double getMaxScore ();
27
+ double getAverageAccuracy ();
28
+ double getAverageSpeed ();
29
+ void printName ();
30
+ void printTotalScore ();
31
+ void printMaxScore ();
32
+ void printAverageAccuracy ();
33
+ void printAverageSpeed ();
34
+ };
35
+
36
+ #endif // !PARTICIPANT_HH
Original file line number Diff line number Diff line change
1
+ #ifndef SENTENCE_HH
2
+ #define SENTENCE_HH
3
+
4
+ #include < iostream>
5
+ #include < sstream>
6
+ #include < fstream>
7
+ #include < string>
8
+ using namespace std ;
9
+
10
+ #include " ./global.hh"
11
+
12
+ class sentence
13
+ {
14
+ private:
15
+ string s;
16
+
17
+ public:
18
+ sentence (int difficulty);
19
+ void addSentence ();
20
+ string getSentence ();
21
+ };
22
+
23
+ #endif // !SENTENCE_HH
You can’t perform that action at this time.
0 commit comments