Program to implement an abstract data type rational-numbers

Assignment Help C/C++ Programming
Reference no: EM13936596

You are writing a program to implement an abstract data type Rational-Numbers. A rational number has two parts, numerator and denominator. Example 1/2 and 3/5 are rational numbers. You can perform math operations on rational numbers and the results are rational numbers. The following are the operations you are to implement.

Test your code with the following data:

Rational numbers: a = 3/8, b= 4/7, c = 1/5, d = 4/12, e = 3/5 f = 4/1 and g = 3/0 (your program should not error)

Compute and output the two rational numbers and their results: a + b, c * d, d / e, c - a

Below is where I am stuck:

Compute a+b*f - d print results

Compute d / a + c print results

Print out 'g' above.

Compare d == b Print both operands and the results.

Compare e != a Print both operands and the results.

Attachment:- rationalheader.zip

Reference no: EM13936596

Questions Cloud

What purpose do you feel the visual arts serve : Devise a definition of art that has meaning for you. What purpose do you feel the visual arts serve? What gives art meaning? Share your thoughts with the class
What are two or three differences between the two mammals : What are two or three differences between the two mammals? To what order does each of the mammal species you selected belong? Describe why they are classified. List two other species that belong to those same orders. The said questions are applied..
Multiple levels of virtual machines : Given a (very) tiny computer that has a word size of 6 bits, what are the smallest negative numbers and the largest positive numbers that this computer can represent in each of the following representations?
Explain how energy moves through an ecosystem : Great Barrier Reef: Explain how energy moves through an ecosystem. Start with producers, move up to keystone predators, and complete the energy flow by including the decomposers.
Program to implement an abstract data type rational-numbers : You are writing a program to implement an abstract data type Rational-Numbers. A rational number has two parts, numerator and denominator. Example 1/2 and 3/5 are rational numbers. You can perform math operations on rational numbers and the result..
Explain why glucose and palmitic acid : Explain why glucose and palmitic acid differ in their water solubility. Predict which molecule would more readily cross a biological membrane composed entirely of phospholipids and justify your reasoning.
What is the current plight of the honey bee : Pick a plant and an animal and tell me how these how plants and animals arrive, find, migrate or develop their habitat, respond to the food chain, climate and other living and non living factors. Give an example or short explanation of each. This ..
Argument to analyse the supplied assignment case study : Use the Toulmin's Model of Argument to analyse the supplied Assignment Case Study (see the Assignment Case Study section below) and provide your opinion on the strength or weakness of the argument with relation to the Claim that we have provided. ..
Explain photosynthesis : Explain photosynthesis and why it occurs in plants and not animals.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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