Rational Numbers Assignments | Online Homework Help

MyHomeworkwriters is the best homework paper service for every learner who wants results fast. We guarantee quality homework services with a fast turnaround time.
Get started Order in Chat
10+
Years of experience
53k
Papers prepared
4.8/5
Customer satisfaction

Description

Define a class for rational numbers. Please download the Test program and add your code for submission.

A rational number is a number that can be represented as the quotient of two integers. For example, 1/2, 3/4, 64/2, and so forth are all rational numbers. (By 1/2, etc., we mean the everyday meaning of the fraction, not the integer division this expression would produce in a C++ program.) Represent rational numbers as two values of type int, one for the numerator and one for the denominator. Call the class Rational.

Include:

  1. a constructor with two arguments that can be used to set the
    member variables of an object to any legitimate values.
  2. a constructor that has only a single parameter of type int; call this single
    parameter whole_number and define the constructor so that the object
    will be initialized to the rational number whole_number/1.
  3. a default constructor that initializes an object to 0 (that is, to 0/1).

Click Here to Place Order           

Overload:

  1. the input and output operators >> and <<. Numbers are to be
    input and output in the form 1/2, 15/32, 300/401, and so forth. Note
    that the numerator, the denominator, or both may contain a minus
    sign, so -1/2, 15/32, and -300/-401 are also possible inputs.
  2. all of the following operators so that they correctly apply to the type
    Rational: ==, <, <=, >, >=, +, -, *, and /.

(Hints: Two rational numbers a/b and c/d are equal if a*d equals
c*b. If b and d are positive rational numbers, a/b is less than c/d
provided a*d is less than c*b. You should include a function to normalize
the values stored so that, after normalization, the denominator
is positive and the numerator and denominator are as small
as possible. For example, after normalization 4/-8 would be represented
the same as -1/2.)

Requirements

  1. DOWNLOAD TEST PROGRAM and add your code for this lab. Do not change any code that’s already inside the test program, but add your class member variables and function definition and implementations
  2. Follow the ADT (Abstract Data Type) guideline to implement the required class.
  3. Comment well in your program and any functions you use

Test Cases

1/2, -1/2, 4, 0, -/12 (should cause error)

Demo

Welcome to the Rational World of Wonders!
Please enter a rational number for this calculation:
1/2
1/2 + 1/2 = 1
1/2 - 1/2 = 0
1/2 * 1/2 = 1/4
1/2 / 1/2 = 1
1/2 == 1/2 : true
1/2 < 1/2 : false
1/2 <= 1/2 : true
1/2 > 1/2 : false
1/2 >= 1/2 : true
Guarantees
What you will get
Professional writers
Our strict writer selection process ensures that only professional college essay writers, subject-matter experts with MA and higher degrees work on your orders.
100% confidentiality
Your personal data is in no way shared with third parties. Writers also do not have access to it. We require your email address for login and notification purposes only.
Affordable prices
Homework Writing Services is a cheap essay writing service offering the best balance between quality and price. Regular customers enjoy special discounts, deals, and other perks.
Original content
We guarantee plagiarism-free work and that your custom college papers will pass Turnitin. Since Turnitin saves all files, we check papers with Copyleaks and Copyscape.
NEVER TRIED A WRITING SERVICE BEFORE?
Here's why students opt for our essay writing company
Hiring a qualified paper writer is one of the best ways to improve your academic writing skills and do better in class.
Lack of time
GPA concerns
Tough topic
Trust issues
When 24 hours is not enough
Most of the students approach us when they are overworked, work in parallel with studies, do internships, and do not have enough time for everything. So, we are their problem solvers and even offer super short 1-3 hour deadlines for emergency requests.
Quick turnaround time. You will receive your
paper before the deadline.
Get started Order in Chat
When grades need a boost
Our experts can help improve your performance and earn you a maximum grade. This is made possible due to the strict quality control, writers' rating system, adherence to requirements, proper formatting, access to all academic databases, credible and up-to-date sources.
Only credible sources. Your work will be based on reputable
sources that provide factual information on the topic.
Get started Order in Chat
When getting help is the best option
Sometimes you can get stuck on a topic, may not be able to find adequate sources, or access to such sources can be too expensive. That's when extra help might be the most valuable tactic to save nerves and meet the deadline with a high-quality paper.
All copyrights belong to you. You can use the delivered
samples in any way you choose.
Get started Order in Chat
When reliable service is needed
We cover almost all types of work, regardless of their complexity. That is why our service is used by college, high school, undergraduate, MA, and Ph.D. students from the USA, UK, and other regions. Besides, we partner with safe payment methods and provide a transparent refund policy.
Money-back guarantee. We will return your money
if you are not satisfied with the result.
Get started Order in Chat
Calculate the price
Make an order in advance and get the best price
Pages (550 words)
$0.00
*Price with a welcome 15% discount applied.
Pro tip: If you want to save more money and pay the lowest price, you need to set a more extended deadline.
We know how difficult it is to be a student these days. That's why our prices are one of the most affordable on the market, and there are no hidden fees.

Instead, we offer bonuses, discounts, and free services to make your experience outstanding.
How it works
Receive a 100% original paper that will pass Turnitin from a top essay writing service
step 1
Upload your instructions
Fill out the order form and provide paper details. You can even attach screenshots or add additional instructions later. If something is not clear or missing, the writer will contact you for clarification.
Pro service tips
How to get the most out of your experience with Homework Writing Services
One writer throughout the entire course
If you like the writer, you can hire them again. Just copy & paste their ID on the order form ("Preferred Writer's ID" field). This way, your vocabulary will be uniform, and the writer will be aware of your needs.
The same paper from different writers
You can order essay or any other work from two different writers to choose the best one or give another version to a friend. This can be done through the add-on "Same paper from another writer."
Copy of sources used by the writer
Our college essay writers work with ScienceDirect and other databases. They can send you articles or materials used in PDF or through screenshots. Just tick the "Copy of sources" field on the order form.
Testimonials
See why 20k+ students have chosen us as their sole writing assistance provider
Check out the latest reviews and opinions submitted by real customers worldwide and make an informed decision.
Business and administrative studies
Excellent.
Customer 462995, June 9th, 2022
Entertainment & Gaming
Great work.
Customer 452441, April 29th, 2022
Other
Excellent work.
Customer 453187, July 5th, 2022
Education
You see, you can write quality papers. Just practice conciseness.
Customer 462495, April 9th, 2022
Art (Fine arts, Performing arts)
Always follow instructions, especially on style.
Customer 460547, March 29th, 2022
Organization behavior
thank you
Customer 462271, November 30th, 2021
Education
Excellent.
Customer 454463, April 25th, 2022
Accounting
Thank you!
Customer 454299, April 21st, 2020
Social Work and Human Services
Excellent.
Customer 460073, June 20th, 2022
Science
Good one.
Customer 453625, May 21st, 2022
SEO
The writer did a really good job on the research.
Customer 463869, April 14th, 2023
Other
Although I did not receive my paper on time, the customer care team ensured that I would receive a quality paper. I am pleased with the revision of this paper.
Customer 452455, March 2nd, 2023
11,595
Customer reviews in total
96%
Current satisfaction rate
3 pages
Average paper length
37%
Customers referred by a friend
OUR GIFT TO YOU
15% OFF your first order
Use a coupon FIRST15 and enjoy expert help with any task at the most affordable price.
Claim my 15% OFF Order in Chat