###### Question:

Create a class called Rational for performing arithmetic with fractions. Write a program to test your class. Use integer variables to represent the private data of the elass the numerator and the denominator. Provide a constructor that enables an object of this class to be initialized when it's declared. The constructor should contain default values in case no initializers are provided and should store the fraction in reduced form. For example, the fraction would be stored in the object as I in the numerator and 2 in the denominator. Provide public member functions that perform each of the following tasks: a) Adding two Rational numbers. The result should be stored in reduced form. b) Subtracting two Rational numbers. The result should be stored in reduced form. c) Multiplying two Rational numbers. The result should be stored in reduced form. d) Dividing two Rational numbers. The result should be stored in reduced form. e) Printing Rational numbers in the form a/b, where a is the numerator and b is the denominator 0 Printing Rational numbers in floating-point format Create an object of class Rational in the main function and test all functions. Sum of vo frutiom+ ch a ad - ch b dbd Differna of tro fradions Product of two fractions:?× e) ad bc Division of taro fradtions: 73+778-29724 29/24 = 1.20833 3-7/813/24 13/24-0.541667 1/3 x 7/8-7/24 724 = 0.291667 1/3 1 718-8/21 8/21-0, 380952

#### Similar Solved Questions

##### The following programaverage stores integer numbers in onlarray coled table and compute the average of innermost...
The following programaverage stores integer numbers in onlarray coled table and compute the average of innermost array The average of each integer or ay is stored in other array called some Answer the three below using this program public class averageMultidis public static void main(String[] args) ...
##### Calculate the molar solubility of Fe(OH)2 in a buffer solution where the pH has been fixed...
Calculate the molar solubility of Fe(OH)2 in a buffer solution where the pH has been fixed at the indicated values. Ksp = 7.9 x 10-16. (a) pH 13.2...
##### Which of the following is true about the filtrate of the glomerulus? A It contains little...
Which of the following is true about the filtrate of the glomerulus? A It contains little or no glucose B It contains little or no protein C It contains little or no sodium D It contains little or no urea E It contains little or no potassium...
##### How do I use the method of moments to find the estimate of theta in the pdf f(x) = {[theta e^(–thetax)",", x >= 0],[0",","otherwise"]:}?
How do I use the method of moments to find the estimate of theta in the pdf f(x) = {[theta e^(–thetax)",", x >= 0],[0",","otherwise"]:}?...
##### Brrect Question 10 0/1 pts Primate social adaptations like physical adaptations to environment come with, a....
brrect Question 10 0/1 pts Primate social adaptations like physical adaptations to environment come with, a. Advantages to food acquisition b. Trades off to support fitness c. Issue dealing with predation d. Mutations e. None of these...
##### Why was it necessary to isolate mitochondria to study and also use engineered vesicles that either...
why was it necessary to isolate mitochondria to study and also use engineered vesicles that either did or did not contain atp synthetase? by the first ATP s r aasing the enzyme to function as an ATPase and result in ATP ATP synthase would likely drive the ATP synh reverse direction, s Original Paper...
##### A bar of unknown material is subjected to an axial tension load P. The bar, having...
A bar of unknown material is subjected to an axial tension load P. The bar, having initial dimensions L = 500 mm and a = b = 25 mm, is observed to elongate by 20 mm. Further, it is observed that the volume of the bar increases by 600 mm3. The bulk modulus of the material is measured at 20,000 MPa. A...
##### Instructions Prepare an incremental analysis to determine whether the current machine should be replaced. E7.15 (LO...
Instructions Prepare an incremental analysis to determine whether the current machine should be replaced. E7.15 (LO 6), AN Veronica Mars, a recent graduate of Bell's accounting program, evaluated the operating performance of Dunn Company's six divisions. Veronica made the following presentat...
##### Converget 1) Determine the given dBouned tive, increasing ,dlecreasin tive or ar alternotin ard...
Converget 1) Determine the given dBouned tive, increasing ,dlecreasin tive or ar alternotin ard converpnt, d a) an-In na :25. ot , divergent. b) an n-0 - ni(バ Converget 1) Determine the given dBouned tive, increasing ,dlecreasin tive or ar alternotin ard converpnt, d a) an-In na :25. ot , d...
##### 4. Zn(s) + H2SO4(aq) → ZnSO4(0) + H2 50.0g of H2SO4 produce how many grams of...
4. Zn(s) + H2SO4(aq) → ZnSO4(0) + H2 50.0g of H2SO4 produce how many grams of H? Type of Rxn 5. Nas) + H2O + NaOH(aq) + H2O) 5.00 moles of H2O produce how many moles of H2? Type of Rxn 6. Cus) + Se → CuS Type of Rxn How many grams of S are needed to produce 10.0g of Cus?...
##### How might the ways in which we produce, deliver, and pay for care be changed in...
How might the ways in which we produce, deliver, and pay for care be changed in order to increase access, improve quality, and the the cost of healthcare services? Please include references in the response....
3) BBE ended their first year of business with the following rights and obligations [Please complete independently from #2] (create only a balance sheet): • BBE owns a delivery truck with a gross value of $200,000, of which$50,000 was depreciated in the first year. • BBE is owed \$25,000 ...