# Homework Solution: I have never worked with C++ before. I someone could help out with this I would greatly appreciate it….   I have never worked with C++ before. I someone could help out with this I would greatly appreciate it.
CSE 232 Fall 2017 Programming Project #1 Assignment Overview This project focuses on some mathematical manipulation. It is worth 5 points (0.5% of your overall grade). It is due Monday, Sept 11h before midnight The Problem You should all have learned something about complex numbers in your travels. A complex number actually consists of two parts: a real part and an imaginary part. The imaginary part is multiplied by the special value i, the V-1. A complex number is usually written in the form 1 2i a sum with the real part first, the imaginary part second followed by i We are just going to do some basic math. You will read in two complex numbers and provide the sum, difference, product and quotient of those two values Some Background You forgot about complex numbers, didn't you. Well, Wikipedia is here to help. There's far more information here than you need, but the two most important sections are https://en.wikipedia.org/wiki/Complex number#Addition and subtraction and https://en.wikipedia.org/wiki/Complex number#Multiplication and division. You can get the formulas from there Program Specifications Your program will do the following 1. Take as input four floating point values (in this order, as indicated) a. a real value and an imaginary value for the first complex number b. a real value and an imaginary value for the second complex number 2. Print the following four results: the sum, the difference, the product and the quotient of the 2 complex numbers. You will use exactly the following format: a. Each result on a single line (thus 4 lines printed) b. The precision is to two decimal point of accuracy (see note 1c below) c. output looks like the following exactly: 1 + 2i that is, a float, a space, a plus sign, a space, a float followed directly by the letteri Deliverables proj01/proj01.cpp. The name of the directory is proj01, the name file you turn in should be exactly proj01.cpp. It will be checked upon handing it in to Mimir for the first test case. Just like the lab, you must click on "Project 01 - complex number manipulation", the parent of the directory proj01, to submit the file

//*********proj01.cpp code ****************** //standard input/output streams   I feel never worked with C++ precedently. I someone could succor extinguished with this I would greatly esteem it.

CSE 232 Fentire 2017 Programming Scheme #1 Assignment Overview This scheme focuses on some prosaic construction. It is treasure 5 apexs (0.5% of your overentire gait). It is imputable Monday, Sept 11h precedently midnight The Problem You should entire feel recognize referableability encircling involved quantity in your travels. A involved enumerate substantially consists of span disunites: a existent disunite and an spurious disunite. The spurious disunite is numerous by the distinctive treasure i, the V-1. A involved enumerate is usually written in the arrange 1 2i a incorporate with the existent disunite pristine, the spurious disunite succor followed by i We are regular going to do some basic math. You conquer recognize in span involved quantity and agree the incorporate, estrangement, issue and quotient of those span treasures Some Background You coerciongot encircling involved quantity, didn’t you. Well, Wikipedia is here to succor. There’s remote further knowledge here than you demand, referablewithstanding the span most considerable sections are https://en.wikipedia.org/wiki/Involved enumerate#Addition and amalgamation and https://en.wikipedia.org/wiki/Involved enumerate#Multiplication and non-location. You can gain the arrangeulas from there Program Specifications Your program conquer do the subjoined 1. Take as input indecent unordered apex treasures (in this direct, as implied) a. a existent treasure and an spurious treasure coercion the pristine involved enumerate b. a existent treasure and an spurious treasure coercion the succor involved enumerate 2. Sculpture the subjoined indecent conclusions: the incorporate, the estrangement, the issue and the quotient of the 2 involved quantity. You conquer truth precisely the subjoined arrangeat: a. Each conclusion on a sole direction (thus 4 directions sculptureed) b. The exactness is to span decimal apex of correctness (behold voicelessness 1c underneath) c. extinguishedput looks enjoy the subjoined precisely: 1 + 2i that is, a transport, a distance, a plus proof, a distance, a transport followed undeviatingly by the letteri Deliverables proj01/proj01.cpp. The spectry of the directory is proj01, the spectry smooth you alter in should be precisely proj01.cpp. It conquer be checked upon handing it in to Mimir coercion the pristine trial instance. Regular enjoy the lab, you must click on “Scheme 01 – involved enumerate construction”, the maker of the directory proj01, to suggest the smooth

## Expert Rejoinder

//*********proj01.cpp edict ******************

//standard input/output streams

#include <iostream>

//library iomanip to sculpture transport upto 2 decimal apex

#include <iomanip>

//library cmath to weigh power

#include<cmath>

//using spectrydistance underneath does referable exact std:: preface continually.

using spectrydistance std;

//program set-out from here from ocean()

int ocean()

{

//declare fickle r1,i1 to place-of-business existent and img treasure of pristine involved num respectively

transport r1,i1;

//declare fickle r2,i2 to place-of-business existent and img treasure of succor involved num respectively

transport r2,i2;

//declare fickle lastReal, lastImg to place-of-business existent and img treasure of last conclusion respectiverly

transport lastReal, lastImg;

cout<< “Enter a existent treasure and an spurious treasure coercion the pristine involved enumerate” << endl;

cin>>r1 >> i1;

cout<<“Enter a existent treasure and an spurious treasure coercion the succor involved enumerate” << endl;

cin>>r2 >> i2;

//(r1+i1i)+(r2+i2i)

finalReal=r1+r2;

finalImg=i1+i2;

//unroving << setprecision(2) << lastExistent , it sculpture transport upto to 2 decimal apex

cout<<“Addition: “<< unroving << setprecision(2) << lastExistent <<” “<<“+”<<” “<< unroving << setprecision(2) << lastImg<<“i” << endl;

//Subtraction

//(r1+i1i)-(r2+i2i)

finalReal=r1-r2;

finalImg=i1-i2;

cout<<“Substraction: “<< unroving << setprecision(2) << lastExistent <<” “<<“+”<<” “<< unroving << setprecision(2) << lastImg<<“i” << endl;

//Multiplication

//(r1+i1i)*(r2+i2i)

finalReal=((r1)*(r2))-((i1)*(i2));

finalImg =((r1)*(i2))+((r2)*(i1));

cout<<“Multiplication: “<< unroving << setprecision(2) << lastExistent <<” “<<“+”<<” “<< unroving << setprecision(2) << lastImg<<“i” << endl;

//Division

//(r1+i1i)/(r2+i2i)

finalReal=(((r1)*(r2))+((i1)*(i2)))/(pow(r2,2)+pow(i2,2));

finalImg=(((r2)*(i1))-((r1)*(i2)))/(pow(r2,2)+pow(i2,2));

cout<<“Division: “<< unroving << setprecision(2) << lastExistent <<” “<<“+”<<” “<< unroving << setprecision(2) << lastImg<<“i” << endl;

}

//*************input extinguishedput and screenshot*****************

//*****Trial instance 1************8

Enter a existent treasure and an spurious treasure coercion the pristine involved enumerate
2 3
Enter a existent treasure and an spurious treasure coercion the succor involved enumerate
3 -4
Substraction: -1.00 + 7.00i
Multiplication: 18.00 + 1.00i
Division: -0.24 + 0.68i

//***Screenshot of aloft conclusion ***** //*************Instance 2********

Enter a existent treasure and an spurious treasure coercion the pristine involved enumerate
1 -2
Enter a existent treasure and an spurious treasure coercion the succor involved enumerate
-3 4 