₦airaland Forum

Welcome, Guest: Register • Login • With Google • Trending • Recent • New

Stats: 3,345,483 members, 8,517,765 topics. Date: Friday, 13 November 2026 at 02:16 AM

Toggle theme

I Need An Urgent Help With A Question In Java. - Programming - Nairaland

Nairaland Forum › Science/Technology › Programming › I Need An Urgent Help With A Question In Java. (894 Views)

1 Reply

I Need An Urgent Help With A Question In Java. by joycej(op): 8:32pm On Jan 16, 2011
Complex numbers have the form for performing arithemetic with complex numbers. Write a driver program to test your class.
complex numbers have d form
real part + imaginary part * i

where i is d root of -1
Use floating-point variables to represent the private data of the class. Provide a constructor
method that enables an object of this class to be initialized when it is declared.
Provide a no-argumentment constructor with default values in case no initializers are provided. Provide public methods
for each of the following:
a) Addition of two Complex numbers: The real parts are added together and the imaginary
parts are added together.
b) Subtraction of two Complex numbers: The real part of the right operand is subtracted
from the real part of the left operand and the imaginary part of the right operand is subtracted
from the imaginary part of the left operand.
c) Printing Complex numbers in the form (a,b), where a is the real part and b is the
imaginary part.
1 Reply

Problem With Bufferedinputstream Read Blocking Issue In Java • I Want To Develop A Software In Java To Calculate CGPA • How Do Io Create Ribbon Ui In Java • 2 • 3 • 4

Gamers Virtual Machine 1.5 Release • Download • US Employee 'outsourced Job To China'