-
Task 1: Write a
print()
method of a Frac class, which prints the fraction as a decimal in standard form:13/18 = 7.(2)x10^-1
-
Task 2: Overload
+, ++, -, --, *, /, <, >, ==
operators for Fraction class. -
Task 3: Solve a problem using a Fraction class: Two guys are climbing on a mountain. When they reach 1/n'th part of the way to the top, they slide down on 1/k'th part of recently climbed path. It's given that on m-th try only 1 meter to the top left. Calculate the total path length to the mountain.
e.g. 2 3 4 -> total path is 3 meters