I am using NetBeans IDE and i have a question that dont have clue with.
I have to design and implement a programme that displays a simple calculator to perform arithmetic operations with complex numbers: addition, subtraction, multiplication, and division. The program should contain a class Complex and a graphical user interface called ComplexGUI.
The question is as follows: Write a graphical user interface called ComplexGUI. The user should enter two complex numbers one after another. The programme should be able to perform the operations with complex numbers represented by objects of Complex class. The GUI should have the following behaviour: 1) Labels "Enter real and imaginary parts of(first or second) complex number separated by comma";
2) Text fields to enter reala and imaginary parts of the first and second numbers;
3) A button which is selected to add two complex numbers;
4) A button which selected to subtract two complex numbers;
5) A button which is selected to multiply two complex numbers;
6) A button which is selected to divide two complex numbers;
7) Label "Answer:"to display the result; The class should include a main method that prepares a frame in which the panel is displayed.
I have attempted to do the class Compex and i have come up with the following code. Please check if i have done it right or not and correct any errors and help me with the ComplexGUI. Thank you
import java.util.Random;
public class Complex { private double real; private double imag;