Exam 4 program

User Generated

ghexrvgz

Programming

Description

Exam 4 program: instructions attached. rewrite the program attached using visual studios as overloads. I've attached the program that needs to rewritten

The main should be something like this:

complex c1,c2,sum,diff,prod;

cout<<"enter first value";

cin>>c1;

cout<<"enter second value";

cin>>c2;

cout<<"original values are""<<c1<<" "<<c2<<endl<<endl;

sum=c1+c2;

cout<<"the sum is"<<sum;

diff=c1-c2;

prod=c1*c2;

cout<<"the product is"<<prod;

if(c1 == c2)

cout<<"equal";

if(c1 != c2)

cout<<"not equal";

cout<<"preincrement:"<<c1<<" "<<++c2;

cout<<"postincrement:"<<c1<<" "<<c2++;

cout<<"after postincrement:"<<c1<<" "<<c2;

return 0;





Unformatted Attachment Preview

#include using namespace std; class complex { private: float real, image; public: complex(float=0.0,float=0.0); void setData(float, float); void add(complex, complex); void sub(complex, complex); void mult(complex, complex); void cube(complex); void printData(); void display(); }; complex::complex(float a, float b) { setData(a,b); } void complex::setData(float a, float b) { real=a; image=b; } void complex::display() { cout
Purchase answer to see full attachment
User generated content is uploaded by users for the purposes of learning and should be used following Studypool's honor code & terms of service.

Explanation & Answer

Hey I am through. The zi...


Anonymous
Great content here. Definitely a returning customer.

Studypool
4.7
Trustpilot
4.5
Sitejabber
4.4

Related Tags