Should take in a complex number then divide it by another complex number, then r
ID: 3641490 • Letter: S
Question
Should take in a complex number then divide it by another complex number, then return the final complex number result.
public ComplexNumber divide(ComplexNumber passedComplexNumber){
MyDouble denom = (this.real.multiply(this.real)).subtract(this.imag.multiply(this.imag));
return new ComplexNumber( (this.real.multiply(passedComplexNumber.real). subtract(this.imag.multiply(passedComplexNumber.imag))) .divide(denom), (((this.real.multiply(passedComplexNumber.imag)). subtract(this.imag.multiply(passedComplexNumber.real))).divide (denom)));
}
Explanation / Answer
#include class Complex { float realpart; float imaginarypart; public: void getdata() { cin>>realpart; cin>>imaginarypart; } void showdata() { coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.