1. Intro and syntax #

Created Wednesday 08 January 2020

Exercises OOPS 1 Official Notes


Assignment - After finishing this section: Fraction class:

  1. Simplify function, find gcd and divide both numerator and denominator.
  2. Add function. This is actually like f1 = f1+f2. i.e we are making **changes **to f1. As there’s nothin to return, no new object is created.
  3. We should use references, i.e int & wherever possible, to avoid the copying overhead.
  4. Also it should be const, so that no change is made to the argument. This is not followed by mutators, because their very objective is to change the value.
  5. We should take care as to what is the use case, and use variables according to that.

Read why const and references are together. http://www.cplusplus.com/doc/tutorial/functions/

Complex Numbers ./complex_numbers.cpp