-
Notifications
You must be signed in to change notification settings - Fork 1
/
13-7grad.h
41 lines (34 loc) · 831 Bytes
/
13-7grad.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
#ifndef GUARD_Grad
#define GUARD_Grad
// Grad.h header file
#include <iostream>
#include <string>
#include <vector>
#include <memory>
#include <iostream>
#include <algorithm>
#include "grade.h"
#include "core.h"
using std::endl;
using std::cout;
class Grad: public Core {
public:
Grad(): thesis(0) { std::cerr << "Grad::Grad()" << endl; }
Grad(std::istream& is)
{
std::cerr << "Grad::Grad(istream&)" << endl;
read(is);
}
std::istream& read(std::istream&);
double grade() const;
bool valid() const {
std::cerr << "thesis: " << thesis << endl;
std::cerr << "homework: " << homework.size() << endl;
return (thesis>0 && !homework.empty());
}
protected:
Grad* clone() const { return new Grad(*this); }
private:
double thesis;
};
#endif //GUARD_Grad