Question: I need help with this C++ program. There's a sample driver file after the instructions, and after that there is a sample run of the

I need help with this C++ program.

There's a sample driver file after the instructions, and after that there is a sample run of the driver file. Note that the driver file is not complete, it should test all cases.

I need help with this C++ program. There's a sample driver fileafter the instructions, and after that there is a sample run ofthe driver file. Note that the driver file is not complete, itshould test all cases. Info: Create a class called Mixed. Objects oftype Mixed will store and manage rational numbers in a mixed numberformat (integer part and a fraction part). The class should be inthe header file, and the member functions definitions should be in another

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. 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

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!