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

  Caselet on michael porter’s value chain management

The assignment in management is a two part assignment dealing 1.Theory of function of management. 2. Operations and Controlling.

  Mountain man brewing company

Mountain Man Brewing, a family owned business where Chris Prangel, the son of the president joins. Due to increase in the preference for light beer drinkers, Chris Prangel wants to introduce light beer version in Mountain Man. An analysis into the la..

  Mountain man brewing company

Mountain Man Brewing, a family owned business where Chris Prangel, the son of the president joins. An analysis into the launch of Mountain Man Light over the present Mountain Man Lager.

  Analysis of the case using the doing ethics technique

Analysis of the case using the Doing Ethics Technique (DET). Analysis of the ethical issue(s) from the perspective of an ICT professional, using the ACS Code of  Conduct and properly relating clauses from the ACS Code of Conduct to the ethical issue.

  Affiliations and partnerships

Affiliations and partnerships are frequently used to reach a larger local audience? Which options stand to avail for the Hotel manager and what problems do these pose.

  Innovation-friendly regulations

What influence (if any) can organizations exercise to encourage ‘innovation-friendly' regulations?

  Effect of regional and corporate cultural issues

Present your findings as a group powerpoint with an audio file. In addition individually write up your own conclusions as to the effects of regional cultural issues on the corporate organisational culture of this multinational company as it conducts ..

  Structure of business plan

This assignment shows a structure of business plan. The task is to write a business plane about a Diet Shop.

  Identify the purposes of different types of organisations

Identify the purposes of different types of organisations.

  Entrepreneur case study for analysis

Entrepreneur Case Study for Analysis. Analyze Robin Wolaner's suitability to be an entrepreneur

  Forecasting and business analysis

This problem requires you to apply your cross-sectional analysis skills to a real cross-sectional data set with the goal of answering a specific research question.

  Educational instructional leadership

Prepare a major handout on the key principles of instructional leadership

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