Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I need help writing the following program using only if else statements, loops,

ID: 3635785 • Letter: I

Question

I need help writing the following program using only if else statements, loops, and arrays. It must include arrays. Any help is greatly appreciated.

You are developing a Fraction structure for Teacher’s Pet Software. The structure con- tains three public data fields for whole number, numerator, and denominator. Using the same structure, write a main()function that declares an array of five Fraction objects. Prompt the user for values for each field of each Fraction. Do not allow the user to enter a value of 0 for the denominator of any Fraction; for each Fraction, continue to prompt the user for a denominator value until a non-zero value is entered. After all the objects have been entered:
» Display the whole number, numerator, and denominator for each of the five Fraction objects as entered.
» Next, display the five Fraction objects all converted to proper form—that is, if the user entered a value such as 2 6/4, now display it as 3 1/2.
» Next, display the sum of all the Fractions and the arithmetic average of all the Fractions.

Explanation / Answer

Here compiled under VS 2010. Ask if u have any questions. #include #include using namespace std; class Fraction { private: int number; int numerator; int denominator; public: const static char seperator = '/'; Fraction() { number = 0; numerator = 0; denominator = 0;} // ~Fraction(); void enterFractionValue(); void reduceFraction(); void displayFraction(); int getnumerator() { return numerator; } int getnumber() {return number;} int getdenominator() { return denominator; } }; void Fraction::enterFractionValue() { string fr; again: cout > number >> numerator >> fr; bool state = false; int i, sl; for (i = 0; i