Welcome! Log In Create A New Profile


Assignment 2 Question 2

Posted by schoema 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Assignment 2 Question 2
August 26, 2009 09:30AM
I have a question about the 2nd question of assignment 02.

How do you want me to implement the add, sub, mul, and div member functions? Must a.add(b) affect the nominator / denominator values of object a, or must it return a third object of type Fraction containing the result?

I’ve also noticed that the formula for “Product of two fractions” is incorrect. Must I use correct one of (ac)/(bd)?

a.add(b) should not affect a or b at all, i.e. it should return a third object of type Fraction. You should be able to use it as follows:
c = a.add(b);

Also, please use the correct formula (ac)/(bd) for the product of two fractions. Apologies for the mistake.
Sorry, only registered users may post in this forum.

Click here to login