-
Notifications
You must be signed in to change notification settings - Fork 0
/
ScottKinneyLab7Fraction.h
46 lines (45 loc) · 1.51 KB
/
ScottKinneyLab7Fraction.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
42
43
44
45
46
/* FILE Fraction Class Specification File
*
* Program name: ScottKinneyLab7Fraction.h
* Discussion : Lab 7 Exercise 1
* Written by: Scott Kinney
* Date:
*/
#include <iostream>
using namespace std;
#ifndef SCOTTKINNEYLAB7FRACTION_H
#define SCOTTKINNEYLAB7FRACTION_H
class FractionScottK {
friend ostream& operator<<(ostream &, const FractionScottK &);
friend istream& operator>>(istream &, FractionScottK &);
private:
int num;
int denom;
public:
FractionScottK();
FractionScottK(int, int);
FractionScottK(const FractionScottK &);
FractionScottK(int);
~FractionScottK();
int getNum() const;
int getDenom() const;
void setNum(int);
void setDenom(int);
void update(const int, const int);
void printFraction(void);
FractionScottK operator+(const FractionScottK &) const;
FractionScottK operator-(const FractionScottK &) const;
FractionScottK operator*(const FractionScottK &) const;
FractionScottK operator/(const FractionScottK &) const;
FractionScottK& operator=(const FractionScottK &);
FractionScottK& operator+=(const FractionScottK &);
FractionScottK& operator-=(const FractionScottK &);
FractionScottK& operator-(void);
bool operator==(const FractionScottK &) const;
bool operator!=(const FractionScottK &) const;
bool operator<=(const FractionScottK &) const;
bool operator<(const FractionScottK &) const;
bool operator>=(const FractionScottK &) const;
bool operator>(const FractionScottK &) const;
};
#endif