Question: Write a modularized program to generate a fraction multiplication table using dynamic memory allocation. Use the fraction class from previous labs. Modify class fraction to

Write a modularized program to generate a fraction multiplication table using dynamic memory allocation. Use the fraction class from previous labs. Modify class fraction to keep track of number of object currently in memory Let the user input a denominator, and then generate all combinations of two such fractions that are between 0 and 1, and multiply them together. Declare a pointer to two dimensional array of pointers. Dynamically allocate two dimensional array of pointers based on the denominator entered by a user. Create fractions dynamically. Only positive fractions. No need to reduce. Well-formatted output is required ( right align all numerical values) Heres an example of the output if the denominator is 7:

private: int numerator; int denominator; int whole public:

Fraction(); Fraction(int n, int d); //Fraction(int nu, int de, int w); Fraction(const Fraction &obj);

~Fraction();

void setdenominator(int); void setwhole(int); void setnumerator(int); void setFraction1(int w, int nu, int de); void setFraction(int nu, int de);

inline int getnumerator() const; inline int getdenominator() const; inline int getwhole() const; void show()const;

you can ignore whole part;

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!