C++ Small Work Operator Overload
$10-30 CAD
货到付款
Most of the code is already there. I do not expect to pay too much as this will be an easy job for you. I will be providing all the files and instructions very easy for you.
Your main task is to complete the code of the Fraction class by defining the operator functions as member functions.
Part of overall job:
Write the definitions and prototypes of following functions in [login to view URL] and Fraction.h respectively (They are indicated in the files by //TODO tag):
Define isEmpty function as a member function, which returns true if the object is in safe empty state (an object is in the safe empty state if denominator (denom) equals -1).
Define display function, which sends a Fraction number to the output stream (with the “Numerator/denominator” format). This function just prints "Invalid Fraction Object!" in the screen if the object is in the safe empty state. In case that object denominator equals 1, it just print the numerator.
Define the operator functions for the following operators:
“+=”, “+”, “*”
The overload of the above operators should make the following code possible:
The member operator+ : Adds two Fraction numbers and returns a Fraction number as the result. This function returns an object with the safe empty state if either of Fraction numbers (operands) is in safe empty state. It makes following code possible:
A+B ( where A and B are Fraction objects)
The member operator+= : Adds two Fraction numbers and assigns the result to the left operand, then returns a reference to the left operand. If either of Fraction numbers (operands) is in safe empty state, it initializes the left operand to the safe empty state, then returns a reference to the left operand. It makes following code possible:
A+=B ( where A and B are Fraction objects)
The member operator* : Multiplies two Fraction numbers and returns a Fraction number as the result. This function returns an object with the safe empty state if either of Fraction numbers (operands) is in safe empty state. It makes following code possible:
A*B ( where A and B are Fraction objects)
项目ID: #13192845
关于项目
授予:
i'm an experienced C++/VC++ developer with solid background of OOP,Data structures and STL. you'll get your job done perfectly. have a look at my profile and reviews :)
有14名威客正在参与此工作的竞标,均价$32/小时
Hi, I am experienced in C++ and object oriented programming. I can do this today. Please contact me.
I m software engineer. I have read the description and I would like to work for you. For further details please inbox me. Thank you
Hello, I am expert in java/c/c++/python/C# and i can deliver your task in the least time and least payments. The code will be well commented and well formatted for better understanding. I believe in long term relations 更多
Hello, read your description and want you to know that I've been working into c++ for almost 3 years with numerous projects in portfolio. I have worked on numerous small and big projects. Your tasks are simple one and 更多
Dear Sir, em a programmer and java/c++ developer, have recently worked on 5 assignment and completed before allocated time. You may please review the comments on my profile to know about my previous work.. I have been 更多
Hello, I am interested in this project. I will do operator loading for you. I did a project before you as well and i hope you liked that as well. Thank You
Hello sir, i am c++ programmer with 2 year experience ! i am new here ! i can make this task in one day .and i agree with your payment conditions. looking forward to hear from you!
I think your's task is very simple so i want to done your's job very cheap. I think i'll do it in two-three hours.