Find Jobs
Hire Freelancers

Write some Software

$10-30 USD

Completed
Posted almost 10 years ago

$10-30 USD

Paid on delivery
struct Complex { float real; float imaginary; }; void displayComplex(Complex n); Displays complex number n in the format: real + i imaginary, where real is n’s real part and imaginary is n’s imaginary part Complex addComplex(Complex a, Complex b); Returns a complex number whose real part is the addition of the real parts of complex numbers a and b, and whose imaginary part is the addition of the imaginary parts of complex numbers a and b, i.e., returns Complex c where [login to view URL] = [login to view URL] + [login to view URL], and [login to view URL] = [login to view URL] + [login to view URL] Complex subtractComplex(Complex a, Complex b); Returns a complex number whose real part is the difference of the real parts of complex numbers a and b, and whose imaginary part is the difference of the imaginary parts of complex numbers a and b, i.e., returns Complex c where [login to view URL] = [login to view URL] - [login to view URL], and [login to view URL] = [login to view URL] - [login to view URL] Complex multiplyComplex(Complex a, Complex b); Returns a complex number whose value is the complex product of complex numbers a and b, e.g., if a = (x + iy) and b = (u + iv), then this function returns Complex c = (xu - yv) + i(xv + yu) void tryToSetComplexByValue(Complex a, float real, float imaginary); Attempts to change the real and imaginary parts of complex argument a, i.e., this function tries to change the value of the original variable passed into parameter a by setting [login to view URL] = real and [login to view URL] = imaginary. Although a’s values will change, the original variable will not because this function is using pass by value. The parameter a is only a copy of the original variable. Make sure you understand why this function fails void setComplexByReference(Complex &a, float real, float imaginary); Successfully changes the real and imaginary parts of complex argument a, i.e., this function changes the value of the original variable passed into parameter a by setting [login to view URL] = real and [login to view URL] = imaginary. The original variable is actually changed since the function is receiving a reference to the original variable. Whatever this function does to the local reference variable a, happens to the original variable passed in since it is being passed in by reference. Make sure you understand why this version of the function works, where the pass by value version did not void setComplexByPointer(Complex *a, float real, float imaginary); This version of the function also succeeds in changing the original values of the complex variable passed into a. Variable a is being passed by reference as a pointer to the original variable. To manipulate the original variable, use pointer dereferencing syntax: a->real = real, and a->imaginary = imaginary. Make sure you understand why these last two versions work, where the pass by value did not Here is a sample output of the program 3 + i2 1 + i4 4 + i6 2 - i2 -5 + i14 3 + i2 4 + i5 5 + i6
Project ID: 5973263

About the project

4 proposals
Remote project
Active 10 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
Here I am again. I had to upgrade account to gain a bid... So It is done, I hop e10 is the right value.
$10 USD in 1 day
5.0 (1 review)
0.0
0.0
4 freelancers are bidding on average $18 USD for this job
User Avatar
hi mate this is Asad, i have a lot of experience in c++ programming,would surely do it for you ,cheers :)
$15 USD in 0 day
5.0 (5 reviews)
3.1
3.1
User Avatar
Hello sir , Consider it done I will provide implementation for the following functions :- voiddisplayComplex(Complex n); Complex addComplex(Complex a, Complex b); Complex subtractComplex(Complex a, Complex b); Complex multiplyComplex(Complex a, Complex b); voidtryToSetComplexByValue(Complex a, float real, float imaginary); voidsetComplexByReference(Complex &a, float real, float imaginary); voidsetComplexByPointer(Complex *a, float real, float imaginary); and run the test to match the output , Regards
$25 USD in 0 day
5.0 (1 review)
2.2
2.2
User Avatar
I have understood what is required in this project clearly. As I am a good C++ programmer it only take maximum 2 hrs to complete perhaps even lesser time. You will receive the running C++ project no errors no warnings.I plan to complete the task in an hour and keep an hour or less to review for any errors not handled in the first hour. Please hire me I will accurately and quickly finish this job. Please free to contact to discuss further details.
$24 USD in 0 day
0.0 (0 reviews)
0.0
0.0
User Avatar
Hi I am an advanced C and C++ programmer and i can finish this job for you within few hours. Let me know by PM if you are interested. thanks
$20 USD in 1 day
0.0 (0 reviews)
0.0
0.0

About the client

Flag of UNITED STATES
Cambridge, United States
4.9
22
Member since Apr 16, 2013

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.