Question: Problem 2: Write a C++ program and algorithm to create a class of fraction having static variables numerator and denominator, and public member functions setting

 Problem 2: Write a C++ program and algorithm to create a

Problem 2: Write a C++ program and algorithm to create a class of fraction having static variables numerator and denominator, and public member functions setting and getting values of the fractions. Generate random values of 100 fraction objects between values 1 to 1000. Create a static member variable of the class having fraction value tolerance of 0.1. Find out how many of the 100 fractions are below and above tolerance level. Decrement the tolerance to 0.01 by a static member function and find out how many of the same fractions are now above and below the new tolerance level. (Marks 10)

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!