Question: C++ Assignment 9.1 [45 points Note: No documentation is required on this assignment n future weeks you will be submitting the client program and class

C++

C++ Assignment 9.1 [45 points Note: No documentation is required on this

assignment n future weeks you will be submitting the client program andclass in separate es, but for this week you will be putting

Assignment 9.1 [45 points Note: No documentation is required on this assignment n future weeks you will be submitting the client program and class in separate es, but for this week you will be putting all of your code, cla and cient program nto a single file to submit The Note class declaration will come first, followed by the definitions of the class member functions, followed by the dient program. objects will Write a fraction class whose represent fractions. For this assignment you aren't required to reduce your fractions. You should provide the following member functions 1. A set() operation that takes two integer arguments, a numerator and a denominator, and sets the calling object accordingly 2. Arithmetic operations that add, subtract, multiply, and divide fractions. These should be implemented as value returning functions that return a fraction object. They should be named addedTO subtract, multiplieday, and dividedey. In the functions you wi eed to declare a local "fraction" variable, assign to it the result of the mathematical operation, and then return it. 3. A boolean operation named iSEqualTo that compares two fraction objects for equality. Since you aren't reducing your fractions, you'll need to do this by cross-multiplying. A little review numerator1 denominator equals denominatori numerator2, then the fractions are equal 4. An output operation named print that displays the value of a fraction object on the screen in the form numerator/denominator. Your class should have exactly two data members, one to represent the numerator of the fraction being represented, and one to represent the denominator of the fraction being represented Here's a hint for how One is the parameter, one is the you wi set up your arithmetic operation functions: You need two fractions calling object. The function multiplies the calling object times the parameter and returns the result. In some ways it is similar to the comesBefore() function from the lesson. That function also needs two fractions, and one is the calling object and one is the parameter. when adding or subtracting fractions, remember that you must first find the common denominator. The easy way to do this is to multiply the denominators together and use that product as the common denominator I am providing a client program for you below. You should copy and paste this and use it as your client program. The output that should be produced when the provided client program is run with your class is also given below, so that you can check your results I strongly suggest that you design your class incrementally. For example, you should first implement only the set function and the output function, and then test what you have so far. Once this code has been thoroughly debugged, you should add additional member functions, testing each one thoroughly as it is added. You might do this by creating your own client program to test the code at each stage; however, it would probably be better to use the provided client program and comment out code that relates to member functions that you have not yet implemented output given belo you are not required to reduce fractions or change improper fractions into mixed numbers for printing. Just print it as an improper fraction. You are As you can see from the sample also not required to deal with negative numbers, either in the nu merator or the deno minator

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!