Design and implement an immutable fraction class

Assignment Help Business Management
Reference no: EM132256313

Please solve this question in C++

Program Description:

Design and implement an immutable Fraction Class described in the Fraction case study. Your class must have the following methods to emulate arithmetic, relational, and I/O operations on Fractions.

1. Arithmetic operators: + - * /

2. Relational operators: < <= > >=

3. Equality operators: == !=

4. Stream Extraction: >> (i.e. 3/7 form)

5. Stream Insertion: << (i.e. 3/7 form)

6. Method to reduce fraction

Specific Requirements:

  • Your main testing program may only have two variables: start and userFraction whichare both of type Fraction.
  • start should contain values set by you that are passed into the constructor.
  • userFraction should start out calling the default constructor and then have its values set through the overloaded >> operator.
  • There are to be no get/set methods for the Fraction class. Having get/set methods in your class will cause you to lose significant  points.
  • Note that the testing program displays the words true or false for the relational operator testing. Be sure to test your program with several different fractions, but for your output you report to me, use the exact test values from the example output. Demonstrate all methods implemented.

Helpful notes:

  • You should create a .h file and two different .cpp files for this lab.
  • You will not need to create a destructor.
  • You may consider making a private helper function or two for simplifying your fraction.

Reference no: EM132256313

Questions Cloud

Identify what that article considers a shortcoming in bps : Identify what that article considers a shortcoming in BP's planning. What part of the contingency planning process came up short.
Level of full-employment output : How would each of the following affect the current level of full-employment output? Explain.
Find the set of discount factors delta : Consider the infinite repetition of the n-firm Bertrand game. Find the set of discount factors Delta for which full collusion (i.e. monopoly pricing)
Describe the different types of monitors and printers : Describe the different types of keyboard, pointing, scanning, image capturing, and audio-input devices. Describe the features and different types of monitors.
Design and implement an immutable fraction class : Design and implement an immutable Fraction Class described in the Fraction case study. Your class must have the following methods to emulate arithmetic
How can the given resistance be overcome : What are the basic reasons that people resist change? How can this resistance be overcome? Include at least 300 words in your reply.
What information was relevant and why : How are the topics of the two articles related to the topic? What information was relevant and why?
What accounting problem that the Linbarger Company faces : Assignment - Ethics in Accounting. What is the accounting problem that the Linbarger Company faces? What are the ethical considerations in this case
Modify and complete the function : 1. Complete the function asn2_1() so it prints the string that is passed to it as a parameter.

Reviews

Write a Review

Business Management Questions & Answers

  Diverse work group look like in organization

What would a diverse work group look like in your organization?

  Transmitting a signal on one end and measuring

Which tool measures cable length by transmitting a signal on one end and measuring the time it takes for the reflection to reach the end of the cable? Which structured cabling component provides connectivity to computer equipment in the nearby work..

  Market price of wheat will cause

Suppose farmers can use their land to grown either wheat or corn. The law of supply predicts that an increase in the market price of wheat will cause:

  Total yield on investments

If S is the amount of money that she invests in Safe Sox and $10,000-S is the amount that she invests in Wobbly Umbrellas, what should S be to maximize her expected utility? (Pick the closest answer.)

  Central driver of the organizational challenges

Why is the rate of growth, the central driver of the organizational challenges, a growing venture faces?

  Explain the advantages and disadvantages of economic system

Write a 525-word (minimum) reflection that includes the following: Identify the economic system discussed in your collaborative discussion. Explain the advantages and disadvantages of this economic system.

  Behavioural studies - learning behaviours

Provide an overview of two leadership behavioural studies, concentrating on their implications to better understand a leader.

  Discuss the two major project processes categories

Discuss the two major project processes categories, what are the distinctions? Identify and discuss the project integration management process.

  Conduct characteristics for employees in it organization

Write down a policy listing expected ethical conduct characteristics for your employees in your IT organization.

  Prepare the incremental analysis to make or buy the lamp

Prepare the incremental analysis to make or buy the lamp Should Chop Inc. buy the lamp shades?

  Administrator of a local youth softball league

You are the chief administrator of a local youth softball league in charge of hiring coaches for the upcoming season.

  Describe the country''s challenges and advantages

Develop a transportation plan that addresses how to move goods to the chosen country.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd