C++ Small Work Operator Overload

已完成 已发布的 7 年前 货到付款
已完成 货到付款

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)

C++编程

项目ID: #13192845

关于项目

14个方案 远程项目 活跃的7 年前

授予:

adeel94

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 :)

$40 CAD 在0天内
(20条评论)
4.6

有14名威客正在参与此工作的竞标,均价$32/小时

urmate

************************ Solution within 2 Hours ******************************************************* HI Contact me for an efficient, perfect, well documented development of your project according to 100% accurac 更多

$30CAD 在1天里
(484条评论)
7.3
xzan88

Hi, I am experienced in C++ and object oriented programming. I can do this today. Please contact me.

$30CAD 在1天里
(111条评论)
6.4
iridescent2x15

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

$70CAD 在1天里
(56条评论)
6.1
xeathprynx

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 更多

$30CAD 在1天里
(105条评论)
5.6
vtatarenko

A proposal has not yet been provided

$30 CAD 在2天内
(10条评论)
3.3
FaizanAhmed14

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 更多

$30CAD 在1天里
(1条评论)
2.3
paariszaheer

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 更多

$10CAD 在1天里
(1条评论)
1.7
asimhussain26

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

$20CAD 在1天里
(1条评论)
0.6
zaidShk

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!

$15CAD 在1天里
(0条评论)
0.0
BaranovMykola

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.

$15CAD 在1天里
(0条评论)
0.0