The One-Stop Software Outsourcing Solution
|
Login
|
|
Show Bid Request
Class Rational
Bid Request Id: 4026
|
Bookmark
|
Posted by: |
Apollo7227 (4 ratings)
(Software buyer rating 10)
|
Posted: |
10/23/2001 4:21:03 AM EST
|
Bidding Closes: |
10/29/2001 EST
|
Viewed: |
176 times
|
|
|
|
Description:
Create a class called Rational for performing arithmetic operations with fractions. Create a console application program. Give your workspace folder the name "Fraction and the client program file the name 'fraction.cpp.' The class definition must include the following: (1)use integer type variables for the private data members of the class and name them as numerator and denominator.(2)provide three constructor methods as follows. A default constructor method that sets numerator=0,and denominator=1. A constructor method with one parameter to set the numerator to the argument value and set the denominator=1. A constuctor method with two parameters to set the numerator and denominator to the argument values. This constructor method using a private method named standardize(),stores the private members in such a way that the numerator is negative whenever the rational number is negative, and both numerator and denominator are positive whenever the rational number is positive. (3)provide the following public member functions (a)Rational add(Rational);purpose:to add the argument rational number to the current rational number and return the resulting rational number(b)Rational subtract(Rational);(c)Rational multiply(Rational);(d)Rational divide(Rational);(e)void display(); purpose:to insert on the standard output stream the current rational number in the form a/b. Your client program must include statements to: (1)accept two integers from the user,then create a rational object 'r1' and display it.(2)accept one non-zero integer from the user, then create a rational object 'r2' and display it.(3)create a rational object 'r3' using the default constructor and then display it.(4)display r1+r2 using the add method(5)display r1+r3 using the add method (6)display r1-r2 using the subtract method (7)display r1*r2 using the multiply method (8)display r1/r2 using the divide method.
Deliverables: I had to put part of the description on this part. Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. And all problems from the disciption ************************* DESCRIPTION (cont'd)
Sample run for your program: Enter two integers with second one non-zero:2,-3 You have entered r1= -2/3 Enter an integer:5 You have entered r2=5/1 Default rational is r3= 0/1 r1+r2=13/3 r1+r3=-2/3 r1-r2=-17/3 r1*r2=-10/3 r1/r2=-2/15 Suppose the user enters -2,-3 then your appropriate constructor method must store numerator =2 and denominator =3. A rational number has negative numerator only when it is negative:-2/3 Provide a private void method simplify() to store the numerator and denominator of the current rational in the reduced form with the greatest common divisor of the numerator and denominator equal to 1. For example, if a current rational object has a numerator =15 and denominator =12 then a call to simplify() will change the numerator to 5 and denominator to 4.
I need this written in Microsoft Visual C++ 6.0
Remember that contacting the other party outside of the site (by email, phone, etc.) on all business projects < $500 (before the buyer's money is escrowed) is a violation of both the software buyer and seller agreements.
We monitor all site activity for such violations and can instantly expel transgressers on the spot, so we thank you in advance for your cooperation.
If you notice a violation, you can report it to: abuse@rentacoder.com.
|
|
Bidding/Comments:
|
All monetary amounts on the site are in United States dollars.
Rent a Coder is a closed auction, so coders can only see their own bids and comments. Buyers can view every posting made on their bid requests. |
See all rejected bids (and all comments)
Name |
Bid Amount |
Date |
Coder Rating |
|
|
This bid was accepted by the buyer!
|
$13
|
10/23/2001 8:01:34 AM EST
|
9.96
(Excellent)
|
|
|
This can be done in less than an hour. Please let meknowthe deadline of this project. Please accept my bid only if you have atleast 1 day of time from start to end of project due to our time zone differences and internet delays, etc...
|
|
|
|
|
|
|
Rent A Coder upholds the rigorous business practices required to be both a BBB member and Square Trade vendor.
- All customer issues addressed within 2 days
- Openly disclosed pricing and return policies
- Participation in mediation at buyer request
- Superior selling track record
This site is verified through it's parent company, Exhedra Solutions, Inc.
|
|
|
See all top coders...
What makes a top coder?
Created in partnership with:
|
|
In memory of the victims and the courageous rescuers of 9/11/2001
|
|