Reference no: EM131395894
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.
Calculate the present value of a sum of money
: Ruth wants to calculate the present value of a sum of money that she will receive after the demise of her grandparents. To calculate the present value, she should use the:
|
Fixed ratio of three boxes of strawberries
: Walt consumes strawberries and cream but only in the fixed ratio of three boxes of strawberries to two cartons of cream. At any other ratio, the excess goods are totally useless to him. The cost of a box of strawberries is $10 and the cost of a ca..
|
Do you feel you missed out on anything because of gender
: How has your sex (female) and the our society's gender roles (femininity) for your sex affected your life to this point?Do you feel you missed out on anything because of gender?What would you change about our society's gendered expectations for women..
|
Dealers association state of industry report
: Download the latest national auto dealers association state of industry report 2014. using the data on new vehicles sale by month forest demand for new vehicles sales for the first three months for the next year.
|
Create a manipulator that formats floating-point values
: 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 value..
|
What is the process associated with becoming certified
: What is the process associated with becoming certified? What is the estimated amount of time necessary to prepare for the certification exam?
|
Concept of price elasticity of demand
: Why managers are interested in the concept of price elasticity of demand? Illustrate with examples Why are managers interested in the concept of consumer surplus? Illustrate with examples.
|
Concept of price elasticity of demand
: Why managers are interested in the concept of price elasticity of demand? Illustrate with examples Why are managers interested in the concept of consumer surplus? Illustrate with examples.
|
Whether given are demonstrative - musical composition
: Determine whether the following are demonstrative definitions, enumerative definitions, definitions by subclass, synonymous definitions, etymological definitions, operational definitions, or definitions by genus and difference.
|