-
Notifications
You must be signed in to change notification settings - Fork 0
/
students.hpp
46 lines (35 loc) · 948 Bytes
/
students.hpp
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
#ifndef STUDENTS_H_
#define STUDENTS_H_
#include "answers.hpp"
#include <string>
namespace student {
// inheriting classes are small, so i put them all in one header.
class base : public answers::writer {
public:
base(std::string name) : _name(name){};
void submit(const equation& eqn, answers::queue* q = answers::Default);
virtual ~base() = default;
private:
virtual solution solve(const equation& eqn) = 0;
std::string _name;
};
class bad : public base {
public:
bad(std::string name) : base(name){};
private:
solution solve(const equation& eqn) override;
};
class good : public base {
public:
good(std::string name) : base(name){};
private:
solution solve(const equation& eqn) override;
};
class average : public base {
public:
average(std::string name) : base(name){};
private:
solution solve(const equation& eqn) override;
};
} // namespace student
#endif // STUDENTS_H_