Submission Deadline:     Saturday 28-6-2003 till 9:30 am (before class)
Submission Folder:         quiz26_6

Write a template-based function that takes an array of any data type and print the frequency of each data item in this array. Write main to call this function on an "int" and a "float" array.



Submission Deadline:     Saturday 28-6-2003 till 9:00 pm
Submission Folder:         rational26_6

Make a class Rational to maintain rational numbers. These numbers are in the form p/q (fractions). Keep all member variables private. Write the following member functions in this class:

Each of these functions should take an object of the same class and perform the desired operation.
After each operation, the function should cancel out any common factor in the numerator and denominator (It would be better to write a separate (private) function to cancel out common factor, and call this function in each of the above functions).

e.g.
main()
{
Rational rat1, rat2;
rat1.ChangeNumerator(2);
rat1.ChangeDenominator(5);
rat2.ChangeNumerator(1);
rat2.ChangeDenominator(10);
rat1.Add(rat2);
rat1.Print();
}

The above program should produce the output:
1/2