clases
crear una clase llamada Numrascionales que realice operaciones con fracciones ademas hacer un testdriver para provar la clase; mediante variables entera representar los datos private ded la clases (numerador y denominador), proporcional una funcion constructor que permita que un objeto ded esta clase sea inicializado cuando se declare. el constructor debera tener valores prededterminado para el caso en el que no se suministren inicializaadores y debera almacenar la fraccion en forma reducida; ademas proporcionar funciones mienmbros piblic para : sumar, restar, multipilcar y dividir numeros racionales ; la impresion debe ser ded la forma a/b y ademas se de imprimir en el formato punto flotante.
espero que alguien me pueda ayudar con esto ya que estoy iniciando en esta area y este es el problema que mas trabajo me ha dado.
espero que alguien me pueda ayudar con esto ya que estoy iniciando en esta area y este es el problema que mas trabajo me ha dado.
En http://www.cs.fiu.edu/~weiss/phc++/code/ encontrarás una implementacción de una posible class Rational, con tres archivos:
Rational.h, Rational.cpp y TestRational.cpp
Tendrás que modificarla levemente para que se ajuste a tus especificaciones. Por ejemplo, al constructor
Rational( int numerator, int denominator )
: numer( numerator ), denom( denominator ) {...}
tendrás que modificarlo a
Rational( int numerator = 0, int denominator = 1)
: numer( numerator ), denom(denominator ) {...}
para que asigne valores por defecto.
Alejandro
Rational.h, Rational.cpp y TestRational.cpp
Tendrás que modificarla levemente para que se ajuste a tus especificaciones. Por ejemplo, al constructor
Rational( int numerator, int denominator )
: numer( numerator ), denom( denominator ) {...}
tendrás que modificarlo a
Rational( int numerator = 0, int denominator = 1)
: numer( numerator ), denom(denominator ) {...}
para que asigne valores por defecto.
Alejandro
Te envio un programa que realiza todas las operaciones con fracciones.
En este mensaje va el header file :
// program k14a1.h - page 263
// fractions header file for k14a1.cpp
// c++ exercices book - dr. gershon kagan - first edition : 2001
// written in Borland CPP ver 3.1
#include <conio.h>
#include<iostream.h>
#include <iomanip.h>
#include <stdlib.h>
class Fraction
{
private:
int numerator;
unsigned int denominator;
int gcd(int,int);
void Reduction();
public:
Fraction(int,int);
Fraction(const Fraction &);
void operator=(const Fraction &);
Fraction operator+(const Fraction &) const;
Fraction operator-(const Fraction &) const;
Fraction operator*(const Fraction &) const;
Fraction operator/(const Fraction &) const;
Fraction operator^(const unsigned int) const;
Fraction operator-() const;
void operator+=(const Fraction &);
void operator-=(const Fraction &);
int operator==(const Fraction &) const;
int operator!=(const Fraction &) const;
int operator>(const Fraction &) const;
int operator<=(const Fraction &) const;
void operator()(Fraction &); // fraction to fraction
void operator()(int,int); // set of numbers to fraction
void operator()(int); // single number to fraction
void operator()(double); // double to fraction
float operator()() const; // fraction to double
friend ostream &operator<<(ostream &,const Fraction &);
friend istream &operator>>(istream &in,Fraction &);
friend Fraction operator+(const int&,const Fraction &);
friend Fraction operator-(const int&,const Fraction &);
friend Fraction operator*(const int&,const Fraction &);
friend Fraction operator/(const int&,const Fraction &);
}; // FRACTION
Fraction::Fraction(int NUM = 0,int DENOM = 1)
{
if (!DENOM)
{
cout << "zero denominator not allowed !" << endl;
exit(1);
}
if(DENOM < 0)
{
NUM = -NUM;
DENOM = -DENOM;
}
numerator = NUM;
denominator = DENOM;
Reduction();
} // FRACTION CONSTRUCTOR
Fraction::Fraction(const Fraction &right) : numerator(right.numerator),
denominator(right.denominator)
{
Reduction();
} // COPY CONSTRUCTOR
void Fraction::operator=(const Fraction &right)
{
numerator = right.numerator;
denominator = right.denominator;
} // OPERATOR =
int Fraction::gcd(int a,int b)
{
if(!a || !b)
return 1;
if(a < 0)
a = -a;
while(a != b)
{
while(a > b)
a -= b;
while(b > a)
b -= a;
}
return a;
} // FRACTION gcd
void Fraction::Reduction()
{
if(!numerator)
return;
int x = gcd(numerator,denominator);
numerator /= x;
denominator /= x;
} // FRACTION REDUCTION
Fraction Fraction::operator+(const Fraction &right) const
{
Fraction ret; // this + right
ret.numerator = numerator*right.denominator +
denominator*right.numerator;
ret.denominator = denominator*right.denominator;
return ret;
} // OPERATOR FRACTION + FRACTION
Fraction Fraction::operator-(const Fraction &right) const
{
Fraction ret; // this - right
ret.numerator = numerator*right.denominator -
denominator*right.numerator;
ret.denominator = denominator*right.denominator;
return ret;
} // OPERATOR FRACTION - FRACTION
Fraction Fraction::operator*(const Fraction &right) const
{
Fraction ret; // this * right
ret.numerator = numerator*right.numerator;
ret.denominator = denominator*right.denominator;
return ret;
} // OPERATOR FRACTION * FRACTION
Fraction Fraction::operator/(const Fraction &right) const
{
Fraction ret; // this / right
ret.numerator = numerator*right.denominator;
ret.denominator = denominator*right.numerator;
return ret;
} // OPERATOR FRACTION * FRACTION
Fraction Fraction::operator^(const unsigned int n) const
{
Fraction ret(1,1); // this ^ n
for(int i = 0;i < n;i++)
ret = ret * (*this);
return ret;
} // OPERATOR FRACTION ^ N
Fraction Fraction::operator-() const
{
Fraction ret; // -this
ret.numerator = -numerator;
ret.denominator = denominator;
return ret;
} // OPERATOR -FRACTION
void Fraction::operator+=(const Fraction &right)
{
*this = *this + right;
} // OPERATOR +=
void Fraction::operator-=(const Fraction &right)
{
*this = *this - right;
} // OPERATOR -=
int Fraction::operator==(const Fraction &right) const
{
return numerator*right.denominator == right.numerator*denominator;
} // OPERATOR EQUAL
int Fraction::operator!=(const Fraction &right) const
{
return !(*this == right);
} // OPERATOR NOT EQUAL
int Fraction::operator>(const Fraction &right) const
{
return numerator*right.denominator > right.numerator*denominator;
} // OPERATOR >
int Fraction::operator<=(const Fraction &right) const
{
return !(*this > right);
} // OPERATOR <=
void Fraction::operator()(Fraction &right)
{
*this = right;
} // OPERATOR () : fraction to fraction
void Fraction::operator()(int D,int N)
{
*this = Fraction(D,N);
} // OPERATOR () : numbers set to fraction
void Fraction::operator()(int N)
{
*this = Fraction(N);
} // OPERATOR () : single number to fraction
void Fraction::operator()(double N)
{
*this = Fraction(int(1000*N),1000);
} // OPERATOR () double to fraction
float Fraction::operator()() const
{
return float(numerator)/denominator;
} // OPERATOR () fraction to float
// ------------------------ friend functions -------------------------
ostream &operator<<(ostream &out,const Fraction &right)
{
out << "(" << right.numerator;
if(right.denominator != 1)
out << "/" << right.denominator;
out << ")";
return out;
} // OPERATOR <<
istream &operator>>(istream &in,Fraction &right)
{
cout << "fraction input : numerator = ";
in >> right.numerator;
cout << " denominator = ";
in >> right.denominator;
right.Reduction();
return in;
} // OPERATOR >>
Fraction operator+(const int &a,const Fraction &right)
{
return right + a;
} // OPERATOR INT + FRACTION
Fraction operator-(const int &a,const Fraction &right)
{
return Fraction(a)-right;
} // OPERATOR INT - FRACTION
Fraction operator*(const int &a,const Fraction &right)
{
return right * a;
} // OPERATOR INT * FRACTION
Fraction operator/(const int &a,const Fraction &right)
{
return Fraction(a) / right;
} // OPERATOR INT / FRACTION
// -------------------------------------------------------------------
En este mensaje va el header file :
// program k14a1.h - page 263
// fractions header file for k14a1.cpp
// c++ exercices book - dr. gershon kagan - first edition : 2001
// written in Borland CPP ver 3.1
#include <conio.h>
#include<iostream.h>
#include <iomanip.h>
#include <stdlib.h>
class Fraction
{
private:
int numerator;
unsigned int denominator;
int gcd(int,int);
void Reduction();
public:
Fraction(int,int);
Fraction(const Fraction &);
void operator=(const Fraction &);
Fraction operator+(const Fraction &) const;
Fraction operator-(const Fraction &) const;
Fraction operator*(const Fraction &) const;
Fraction operator/(const Fraction &) const;
Fraction operator^(const unsigned int) const;
Fraction operator-() const;
void operator+=(const Fraction &);
void operator-=(const Fraction &);
int operator==(const Fraction &) const;
int operator!=(const Fraction &) const;
int operator>(const Fraction &) const;
int operator<=(const Fraction &) const;
void operator()(Fraction &); // fraction to fraction
void operator()(int,int); // set of numbers to fraction
void operator()(int); // single number to fraction
void operator()(double); // double to fraction
float operator()() const; // fraction to double
friend ostream &operator<<(ostream &,const Fraction &);
friend istream &operator>>(istream &in,Fraction &);
friend Fraction operator+(const int&,const Fraction &);
friend Fraction operator-(const int&,const Fraction &);
friend Fraction operator*(const int&,const Fraction &);
friend Fraction operator/(const int&,const Fraction &);
}; // FRACTION
Fraction::Fraction(int NUM = 0,int DENOM = 1)
{
if (!DENOM)
{
cout << "zero denominator not allowed !" << endl;
exit(1);
}
if(DENOM < 0)
{
NUM = -NUM;
DENOM = -DENOM;
}
numerator = NUM;
denominator = DENOM;
Reduction();
} // FRACTION CONSTRUCTOR
Fraction::Fraction(const Fraction &right) : numerator(right.numerator),
denominator(right.denominator)
{
Reduction();
} // COPY CONSTRUCTOR
void Fraction::operator=(const Fraction &right)
{
numerator = right.numerator;
denominator = right.denominator;
} // OPERATOR =
int Fraction::gcd(int a,int b)
{
if(!a || !b)
return 1;
if(a < 0)
a = -a;
while(a != b)
{
while(a > b)
a -= b;
while(b > a)
b -= a;
}
return a;
} // FRACTION gcd
void Fraction::Reduction()
{
if(!numerator)
return;
int x = gcd(numerator,denominator);
numerator /= x;
denominator /= x;
} // FRACTION REDUCTION
Fraction Fraction::operator+(const Fraction &right) const
{
Fraction ret; // this + right
ret.numerator = numerator*right.denominator +
denominator*right.numerator;
ret.denominator = denominator*right.denominator;
return ret;
} // OPERATOR FRACTION + FRACTION
Fraction Fraction::operator-(const Fraction &right) const
{
Fraction ret; // this - right
ret.numerator = numerator*right.denominator -
denominator*right.numerator;
ret.denominator = denominator*right.denominator;
return ret;
} // OPERATOR FRACTION - FRACTION
Fraction Fraction::operator*(const Fraction &right) const
{
Fraction ret; // this * right
ret.numerator = numerator*right.numerator;
ret.denominator = denominator*right.denominator;
return ret;
} // OPERATOR FRACTION * FRACTION
Fraction Fraction::operator/(const Fraction &right) const
{
Fraction ret; // this / right
ret.numerator = numerator*right.denominator;
ret.denominator = denominator*right.numerator;
return ret;
} // OPERATOR FRACTION * FRACTION
Fraction Fraction::operator^(const unsigned int n) const
{
Fraction ret(1,1); // this ^ n
for(int i = 0;i < n;i++)
ret = ret * (*this);
return ret;
} // OPERATOR FRACTION ^ N
Fraction Fraction::operator-() const
{
Fraction ret; // -this
ret.numerator = -numerator;
ret.denominator = denominator;
return ret;
} // OPERATOR -FRACTION
void Fraction::operator+=(const Fraction &right)
{
*this = *this + right;
} // OPERATOR +=
void Fraction::operator-=(const Fraction &right)
{
*this = *this - right;
} // OPERATOR -=
int Fraction::operator==(const Fraction &right) const
{
return numerator*right.denominator == right.numerator*denominator;
} // OPERATOR EQUAL
int Fraction::operator!=(const Fraction &right) const
{
return !(*this == right);
} // OPERATOR NOT EQUAL
int Fraction::operator>(const Fraction &right) const
{
return numerator*right.denominator > right.numerator*denominator;
} // OPERATOR >
int Fraction::operator<=(const Fraction &right) const
{
return !(*this > right);
} // OPERATOR <=
void Fraction::operator()(Fraction &right)
{
*this = right;
} // OPERATOR () : fraction to fraction
void Fraction::operator()(int D,int N)
{
*this = Fraction(D,N);
} // OPERATOR () : numbers set to fraction
void Fraction::operator()(int N)
{
*this = Fraction(N);
} // OPERATOR () : single number to fraction
void Fraction::operator()(double N)
{
*this = Fraction(int(1000*N),1000);
} // OPERATOR () double to fraction
float Fraction::operator()() const
{
return float(numerator)/denominator;
} // OPERATOR () fraction to float
// ------------------------ friend functions -------------------------
ostream &operator<<(ostream &out,const Fraction &right)
{
out << "(" << right.numerator;
if(right.denominator != 1)
out << "/" << right.denominator;
out << ")";
return out;
} // OPERATOR <<
istream &operator>>(istream &in,Fraction &right)
{
cout << "fraction input : numerator = ";
in >> right.numerator;
cout << " denominator = ";
in >> right.denominator;
right.Reduction();
return in;
} // OPERATOR >>
Fraction operator+(const int &a,const Fraction &right)
{
return right + a;
} // OPERATOR INT + FRACTION
Fraction operator-(const int &a,const Fraction &right)
{
return Fraction(a)-right;
} // OPERATOR INT - FRACTION
Fraction operator*(const int &a,const Fraction &right)
{
return right * a;
} // OPERATOR INT * FRACTION
Fraction operator/(const int &a,const Fraction &right)
{
return Fraction(a) / right;
} // OPERATOR INT / FRACTION
// -------------------------------------------------------------------
Aqui te envio el programa en cpp:
// program k14a1.cpp - page 263
// fractions aplication program.
// c++ exercices book - dr. gershon kagan - first edition : 2001
// written in Borland CPP ver 3.1
#include "k14a1.h"
void Add()
{
Fraction a(5,12),b(4,3),c;
int x = 1;
c = a + b;
cout << setw(20) << a << " + " << b << " = " << c << endl;
c = a + x;
cout << setw(20) << a << " + " << x << " = " << c << endl;
c = x + a;
cout << setw(20) << x << " + " << a << " = " << c << endl;
cout << setw(20) << c << " + " << b << " = ";
c += b;
cout << c << endl << endl;
} // ADD
void Subtract()
{
Fraction a(5,12),b(4,3),c;
int x = 2;
c = a - b;
cout << setw(20) << a << " - " << b << " = " << c << endl;
cout << setw(20) << c << " - " << a;
c -= a;
cout << " = " << c << endl;
cout << setw(22) << " -(" << c << ") = ";
c = -c;
cout << c << endl;
c = a - x;
cout << setw(20) << a << " - " << x << " = " << c << endl;
c = x - a;
cout << setw(20) << x << " - " << a << " = " << c << endl << endl;
} // SUBTRACT
void Multiply()
{
Fraction a(5,12),b(4,3),c;
int x = 5;
c = a*b;
cout << setw(20) << a << " * " << b << " = " << c << endl;
c = a*x;
cout << setw(20) << a << " * " << x << " = " << c << endl;
c = x*a;
cout << setw(20) << x << " * " << a << " = " << c << endl << endl;
} // MULTIPLY
void Divide()
{
Fraction a(5,12),b(4,3),c;
int x = 5;
c = a/b;
cout << setw(20) << a << " / " << b << " = " << c << endl;
c = a/x;
cout << setw(20) << a << " / " << x << " = " << c << endl;
c = x/a;
cout << setw(20) << x << " / " << a << " = " << c << endl << endl;
} // MULTIPLY
void Pot()
{
Fraction a(3,5);
for(int x = 0; x < 6;x++)
cout << setw(20) << a << "^" << x << " = " << (a^x) << endl;
cout << endl;
} // POT
void LogicOperators()
{
Fraction a(3,4),b(7,3),c(6,8);
cout << setw(20) << a << " == " << b << " -----> " << (a == b) << endl;
cout << setw(20) << a << " == " << c << " -----> " << (a == c) << endl;
cout << setw(20) << a << " != " << b << " -----> " << (a != b) << endl;
cout << setw(20) << a << " > " << b << " -----> " << (a > b) << endl;
cout << setw(20) << a << " <= " << b << " -----> " << (a <= b) << endl
<< endl;
} // LOGIC OPERATORS
void Parenthesis()
{
Fraction a(3,17),b;
cout << setw(40) << "a = " << a << endl;
b(a);
cout << setw(40) << "fraction to fraction b(a) = " << b << endl;
b(5,12);
cout << setw(40) << "numbers set to fraction b(5,12) = " << b << endl;
b(11);
cout << setw(40) << "one number to fraction b(11) = " << b << endl;
b(double(1.75));
cout << setw(40) << "float to fraction b(1.75) = " << b << endl;
float x = b();
cout << setw(40) << "fraction to float x = b() = " << x << endl << endl;
} // PARENTHESIS OPERATORS
void InputOutput()
{
Fraction a,b;
cin >> a;
cin >> b;
cout << endl;
cout << a << " + " << b << " = " << a + b << endl;
cout << a << " - " << b << " = " << a - b << endl;
cout << a << " * " << b << " = " << a * b << endl;
cout << a << " / " << b << " = " << a / b << endl;
} // INPUT OUTPUT
void Process()
{
Add();
Subtract();
Multiply();
Divide();
Pot();
LogicOperators();
Parenthesis();
InputOutput();
} // PROCESS
void main()
{
clrscr();
cout << "fractions main programn";
cout << "-----------------------------------------------------"
"-------------------------n";
Process();
cout << "-----------------------------------------------------"
"-------------------------n";
cout << "end of program - good bye ! ! !n";
getch();
} // MAIN
/*
fractions main program
------------------------------------------------------------------------------
(5/12) + (4/3) = (7/4)
(5/12) + 1 = (17/12)
1 + (5/12) = (17/12)
(17/12) + (4/3) = (11/4)
(5/12) - (4/3) = (-11/12)
(-11/12) - (5/12) = (-4/3)
-((-4/3)) = (4/3)
(5/12) - 2 = (-19/12)
2 - (5/12) = (19/12)
(5/12) * (4/3) = (5/9)
(5/12) * 5 = (25/12)
5 * (5/12) = (25/12)
(5/12) / (4/3) = (5/16)
(5/12) / 5 = (1/12)
5 / (5/12) = (12)
(3/5)^0 = (1)
(3/5)^1 = (3/5)
(3/5)^2 = (9/25)
(3/5)^3 = (27/125)
(3/5)^4 = (81/625)
(3/5)^5 = (243/3125)
(3/4) == (7/3) -----> 0
(3/4) == (3/4) -----> 1
(3/4) != (7/3) -----> 1
(3/4) > (7/3) -----> 0
(3/4) <= (7/3) -----> 1
a = (3/17)
fraction to fraction b(a) = (3/17)
numbers set to fraction b(5,12) = (5/12)
one number to fraction b(11) = (11)
float to fraction b(1.75) = (7/4)
fraction to float x = b() = 1.75
fraction input : numerator = 5
denominator = 3
fraction input : numerator = 3
denominator = 5
(5/3) + (3/5) = (34/15)
(5/3) - (3/5) = (16/15)
(5/3) * (3/5) = (1)
(5/3) / (3/5) = (25/9)
------------------------------------------------------------------------------
end of program - good bye ! ! !
*/
// program k14a1.cpp - page 263
// fractions aplication program.
// c++ exercices book - dr. gershon kagan - first edition : 2001
// written in Borland CPP ver 3.1
#include "k14a1.h"
void Add()
{
Fraction a(5,12),b(4,3),c;
int x = 1;
c = a + b;
cout << setw(20) << a << " + " << b << " = " << c << endl;
c = a + x;
cout << setw(20) << a << " + " << x << " = " << c << endl;
c = x + a;
cout << setw(20) << x << " + " << a << " = " << c << endl;
cout << setw(20) << c << " + " << b << " = ";
c += b;
cout << c << endl << endl;
} // ADD
void Subtract()
{
Fraction a(5,12),b(4,3),c;
int x = 2;
c = a - b;
cout << setw(20) << a << " - " << b << " = " << c << endl;
cout << setw(20) << c << " - " << a;
c -= a;
cout << " = " << c << endl;
cout << setw(22) << " -(" << c << ") = ";
c = -c;
cout << c << endl;
c = a - x;
cout << setw(20) << a << " - " << x << " = " << c << endl;
c = x - a;
cout << setw(20) << x << " - " << a << " = " << c << endl << endl;
} // SUBTRACT
void Multiply()
{
Fraction a(5,12),b(4,3),c;
int x = 5;
c = a*b;
cout << setw(20) << a << " * " << b << " = " << c << endl;
c = a*x;
cout << setw(20) << a << " * " << x << " = " << c << endl;
c = x*a;
cout << setw(20) << x << " * " << a << " = " << c << endl << endl;
} // MULTIPLY
void Divide()
{
Fraction a(5,12),b(4,3),c;
int x = 5;
c = a/b;
cout << setw(20) << a << " / " << b << " = " << c << endl;
c = a/x;
cout << setw(20) << a << " / " << x << " = " << c << endl;
c = x/a;
cout << setw(20) << x << " / " << a << " = " << c << endl << endl;
} // MULTIPLY
void Pot()
{
Fraction a(3,5);
for(int x = 0; x < 6;x++)
cout << setw(20) << a << "^" << x << " = " << (a^x) << endl;
cout << endl;
} // POT
void LogicOperators()
{
Fraction a(3,4),b(7,3),c(6,8);
cout << setw(20) << a << " == " << b << " -----> " << (a == b) << endl;
cout << setw(20) << a << " == " << c << " -----> " << (a == c) << endl;
cout << setw(20) << a << " != " << b << " -----> " << (a != b) << endl;
cout << setw(20) << a << " > " << b << " -----> " << (a > b) << endl;
cout << setw(20) << a << " <= " << b << " -----> " << (a <= b) << endl
<< endl;
} // LOGIC OPERATORS
void Parenthesis()
{
Fraction a(3,17),b;
cout << setw(40) << "a = " << a << endl;
b(a);
cout << setw(40) << "fraction to fraction b(a) = " << b << endl;
b(5,12);
cout << setw(40) << "numbers set to fraction b(5,12) = " << b << endl;
b(11);
cout << setw(40) << "one number to fraction b(11) = " << b << endl;
b(double(1.75));
cout << setw(40) << "float to fraction b(1.75) = " << b << endl;
float x = b();
cout << setw(40) << "fraction to float x = b() = " << x << endl << endl;
} // PARENTHESIS OPERATORS
void InputOutput()
{
Fraction a,b;
cin >> a;
cin >> b;
cout << endl;
cout << a << " + " << b << " = " << a + b << endl;
cout << a << " - " << b << " = " << a - b << endl;
cout << a << " * " << b << " = " << a * b << endl;
cout << a << " / " << b << " = " << a / b << endl;
} // INPUT OUTPUT
void Process()
{
Add();
Subtract();
Multiply();
Divide();
Pot();
LogicOperators();
Parenthesis();
InputOutput();
} // PROCESS
void main()
{
clrscr();
cout << "fractions main programn";
cout << "-----------------------------------------------------"
"-------------------------n";
Process();
cout << "-----------------------------------------------------"
"-------------------------n";
cout << "end of program - good bye ! ! !n";
getch();
} // MAIN
/*
fractions main program
------------------------------------------------------------------------------
(5/12) + (4/3) = (7/4)
(5/12) + 1 = (17/12)
1 + (5/12) = (17/12)
(17/12) + (4/3) = (11/4)
(5/12) - (4/3) = (-11/12)
(-11/12) - (5/12) = (-4/3)
-((-4/3)) = (4/3)
(5/12) - 2 = (-19/12)
2 - (5/12) = (19/12)
(5/12) * (4/3) = (5/9)
(5/12) * 5 = (25/12)
5 * (5/12) = (25/12)
(5/12) / (4/3) = (5/16)
(5/12) / 5 = (1/12)
5 / (5/12) = (12)
(3/5)^0 = (1)
(3/5)^1 = (3/5)
(3/5)^2 = (9/25)
(3/5)^3 = (27/125)
(3/5)^4 = (81/625)
(3/5)^5 = (243/3125)
(3/4) == (7/3) -----> 0
(3/4) == (3/4) -----> 1
(3/4) != (7/3) -----> 1
(3/4) > (7/3) -----> 0
(3/4) <= (7/3) -----> 1
a = (3/17)
fraction to fraction b(a) = (3/17)
numbers set to fraction b(5,12) = (5/12)
one number to fraction b(11) = (11)
float to fraction b(1.75) = (7/4)
fraction to float x = b() = 1.75
fraction input : numerator = 5
denominator = 3
fraction input : numerator = 3
denominator = 5
(5/3) + (3/5) = (34/15)
(5/3) - (3/5) = (16/15)
(5/3) * (3/5) = (1)
(5/3) / (3/5) = (25/9)
------------------------------------------------------------------------------
end of program - good bye ! ! !
*/
