Created
November 29, 2011 14:44
-
-
Save edhedges/1405035 to your computer and use it in GitHub Desktop.
Fraction Computation Header file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/********************************************** | |
* fraction.h: this header file has the private | |
fields used in fraction.cpp and also has the | |
prototypes for the functions in fraction.cpp. * | |
***********************************************/ | |
#ifndef FRACTION_H | |
#define FRACTION_H | |
/********************************************** | |
* class Fraction: this class allows us to make | |
"Fractions". * | |
***********************************************/ | |
class Fraction{ | |
/********************************************** | |
* This is where the private fields are for the | |
numerator and denominator of a fraction. * | |
***********************************************/ | |
private: | |
int num; | |
int denom; | |
/********************************************** | |
* This is where the prototypes of the functions | |
used in fraction.cpp are declared. * | |
***********************************************/ | |
public: | |
void setValues(int, int); | |
Fraction plus(Fraction); | |
Fraction minus(Fraction); | |
Fraction times(Fraction); | |
Fraction divide(Fraction); | |
Fraction reduce(); | |
void print(void); | |
}; | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment