Create a manipulator that formats floating-point values to


You have been developing a Fraction class for Teacher's Pet Software. Each Fraction contains a numerator, denominator, a whole-number portion, and access to several functions you have developed, including overloaded operators. Complete these tasks:

a. Create a manipulator that formats floating-point values to display with three decimal places right-aligned in a field of 10 spaces. Write a main()function that instantiates an array of at least 10 Fraction objects, prompts the user for their values, and displays their floating-point values using the manipulator. Save the file as FractionManipulator.cpp.

b. Modify the Fraction class so that the insertion and extraction operators write and read the three parts of a Fraction (whole number, numerator, and denominator) separated by spaces. Use these operators when writing to and reading from a file. Make sure the Fraction class also contains data entry and display functions that allow user-friendly display on the screen (for example, with a slash between numerator and denominator) and data entry from the keyboard (with appropriate prompts). As a Fraction drill, write a program that prompts a student user to enter five Fraction objects for which each Fraction value is less than 1/2. Create a disk file that contains the Fractions the student creates. Save the file as FractionFile.cpp.

c. Write a program a teacher can use to review a student's progress. The program reads the Fraction objects previously created by the student and saved to disk. The program compares each Fraction to 1/2 and displays the Fraction answers that are incorrect (1/2 or more). At the end of the file, display a percent-correct score for the five student answers. Save the file as FractionGrader.cpp.

d. Teachers using the FractionFile and FractionGrader programs have discovered that students are "cheating" by learning one Fraction value that is less than 1/2, for example 1/3, and typing it for all five entries in the FractionFile program. Modify the program so that no duplicates are accepted and that five unique values are written to the data file. Save the file as FractionFileNoRepeats.cpp.

Request for Solution File

Ask an Expert for Answer!!
Basic Computer Science: Create a manipulator that formats floating-point values to
Reference No:- TGS02192538

Expected delivery within 24 Hours