Question
For the complex class, Create the add() and Subtract() methods The add method-->Adds the current and the given complex numbers together, and stores the sum
For the complex class, Create the add() and Subtract() methods
The add method-->Adds the current and the given complex numbers together, and stores the sum in a new Complex object. The current and given complex numbers are not altered in the process. @param other the other complex number to add to this one @return the new Complex object that holds the result of the addition
the subtract method--> Subtracts the other complex number from this one, and stores the result in a new Complex object. The current and given complex numbers are not altered in the process. @param other the other complex number to subtract from this one @return the new Complex object that holds the result of the subtraction
For the money class, just write the toString method The toString method-->Provides a string representation of the current Money object, in the form $mm.mm. Negative values have a minus sign before the dollar sign. Zero dollar amounts are represented with one zero between the dollar sign and the decimal point. Cents that are multiples of 10 still show two decimal places. (Examples: $12.34, -$6.50, $0.99, -$0.99, $0.00) @return the string representation
Money (leaf Complex (leaft -dollars: long -real: double -imaginary: double +Money() +Money(dollars:long, cents: byte) +getDollars(): long +getcents(): byte tadd(other: Money): Money +subtract(other: Money): Money +toString(): String +Complex() +Complex(real:double, imaginary: double) +getReal(): double +getlmaginary(): double +add(other: Complex): Complex +subtract(other: Complex): Complex +toString(): StringStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started