Difference: Lab9 (3 vs. 4)

Revision 42015-11-18 - JimSkon

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

Lab 9

Due: Nov 19, 11:55pm

Line: 30 to 30
 
  • (a/b) / (c/d) = (a*d) / (c*b)
  • -(a/b) = (-a/b)
  • (a/b) < (c/d) means (a*d) < (c*b)
Changed:
<
<
  • (a/b) = (c/d) means (a*d) = (c*b)
>
>
  • (a/b) = (c/d) means (a*d) = (c*b)
 Let any sign be carried by the numerator; keep the denominator positive.
Changed:
<
<

Class member funtions

>
>

Class member functions

 
Changed:
<
<
Will need at least the following class methods for the class Rational:
>
>
You will need at least the following class methods for the class Rational:
 
Changed:
<
<
  • Rational(); // Defaul constructor
>
>
  • Rational(); // Default constructor
 
  • Rational(int x, int y); // constructor
  • Rational(int x); // Constructor of x/1
  • Rational add(Rational x);
Line: 47 to 47
 
  • bool equals(Rational x);
  • void input(); // Inputs into this rational
  • void output(x); // Outputs this rational
Added:
>
>
  • int getNum(); // Get the numerator
  • int getDem(); // Get denominator
 

Program Operation

Write a mainline that asks for two rational numbers to be typed in, and does all of the operations, just as seen in the example below:

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback