import java.util.Scanner;

public class ComplexCalculator
{
	// This program will prompt the user for two complex numbers and 
	// display the sum, difference, product and quotient of the numbers 
	public static void main(String [] args)
	{
		Scanner keyboard = new Scanner(System.in);
		
		System.out.print("Please enter the real part of the first complex number: ");
		int r1 = keyboard.nextInt();
		
		System.out.print("Please enter the imaginary part of the first complex number: ");
		int i1 = keyboard.nextInt();
		
		System.out.print("Please enter the real part of the second complex number: ");
		int r2 = keyboard.nextInt();
		
		System.out.print("Please enter the imaginary part of the second complex number: ");
		int i2 = keyboard.nextInt();
		
		ComplexNumber c1 = new ComplexNumber(r1, i1);
		ComplexNumber c2 = new ComplexNumber(r2, i2);
		
		
		ComplexNumber c3 = c1.add(c2);
		System.out.println("The sum: " + c3.getReal() + " + " + c3.getImaginary() + "i");
		
		ComplexNumber c4 = c1.subtract(c2);
		System.out.println("The differnce: " + c4.getReal() + " + " + c4.getImaginary() + "i");
		
		ComplexNumber c5 = c1.multiply(c2);
		System.out.println("The product: " + c5.getReal() + " + " + c5.getImaginary() + "i");
		
		ComplexNumber c6 = c1.divide(c2);
		System.out.println("The quotient: " + c6.getReal() + " + " + c6.getImaginary() + "i");
		
		
	}
	
}
		