Question: I need help with this C++ program. There are three separate files i need, one is a header file, one is the corresponding c++ file
I need help with this C++ program. There are three separate files i need, one is a header file, one is the corresponding c++ file with function definitions, and the other is the driver file that will test the program and its conditions. I'm attaching a sample driver file (that is incomplete, it doesn't test all conditions) and a sample run as well. Thanks!



Here is the sample driver file:

And here is the sample run (test):

You can take your time and post, then keep me updated in the comments whether it's incomplete so that you can update the answer.
Thanks for the help!
Info: Create a class called Mixed. Objects of type Mixed will store and manage rational numbers in a mixed number format (integer part and a fraction part). The class should be in the header file, and the member functions definitions should be in another file 1. The class you create must allow for storage of rational numbers in a mixed number format (like 3 1/2 "three and The Mixed must allow for both positive and negative mixed number values. A zero in the denominator of the fraction part constitutes an illegal number and should not be allowed. You should create appropriate member data in your class. All member data must be private. 2. There should be two constructors. One constructor should take in three parameters, representing the integer part, the numerator, and the denominator (in that order), used to initialize the object. If the mixed number is to be a negative number, the negative should be passed on the first non-zero parameter, but on no others. If the data passed in is invalid (negatives not fitting the rule, or 0 denominator), then simply set the object to represent the value 0. Examples of declarations of objects: sets object to 3 4 5 Mixed ml (3, 4, 5) sets object to 4 1/2 Mixed m2 (-4, 1, 2); sets object to 3/5 integer part is 0 Mixed m3 (0, -3, 5) Mixed m 4 (-1, 2, bad parameter combination. Set object to 0 The other constructor should expect a single int parameter with a default value of 0 (so that it also acts as a default constructor). This constructor allows an integer to be passed in and represented as a Mixed object. This means that there is no fractional part. Example declarations: Mixed m5 (4) sets object to 4 (i.ee 4 and no fractional part) Mixed 6; sets object to 0 default Note that this last constructor will act as a "conversion constructor allowing automatic type conversions from type int to type Mixed
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
