-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmixednumber.h
35 lines (29 loc) · 856 Bytes
/
mixednumber.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
#ifndef MIXEDNUMBER_H
#define MIXEDNUMBER_H
#include <iostream>
#include <fstream>
#include "fraction.h"
#include "streamutilities.h"
class mixedNumber : public fraction
{
public:
mixedNumber();
~mixedNumber();
mixedNumber(int w, int n, int d);
mixedNumber(const mixedNumber &other);
mixedNumber(const double &other);
mixedNumber& operator=(const mixedNumber &other);
mixedNumber& operator=(const fraction &other);
mixedNumber& operator=(const int &other);
mixedNumber& operator=(const double &other);
void getValues(int &w, int &n, int &d);
void setValues(int w, int n, int d);
friend
std::ostream& operator<<( std::ostream &out, const mixedNumber &m);
friend
std::istream& operator>>( std::istream &in, mixedNumber &m);
private:
void copy(const mixedNumber &other);
void nukeEveryone();
};
#endif // MIXEDNUMBER_H