#include "complex.h"
#include <stdio.h>

int main(int argc, char **argv){
	printf("Small Complex Numbers Calculator\n");

	complex display = complex_zero();
	char option;

	while(1){
		printf("DISPLAY: ");
		print(display);
		printf("Type +, -, *, n for new display, or q to quit.\n");
		printf("Option: ");
		scanf(" %c",&option);

		if (option == 'q'){
			printf("Bye!");
			return 0;
		}
		if (option == 'n'){
			printf("Enter new display value (real part): ");
			scanf("%lf",&display.a);
			printf("Enter new display value ( img part): ");
			scanf("%lf",&display.b);
		}
		if (option == '+'){
			double x,y;

			printf("Enter number to add (real part): ");
			scanf("%lf",&x);
			printf("Enter number to add ( img part): ");
			scanf("%lf",&y);

			complex c = complex_create(x,y);
			display = complex_add(display, c);
		}
		if (option == '-'){
			double x,y;

			printf("Enter number to subtract (real part): ");
			scanf("%lf",&x);
			printf("Enter number to subtract ( img part): ");
			scanf("%lf",&y);

			complex c = complex_create(x,y);
			display = complex_sub(display, c);
		}
		if (option == '*'){
			double x,y;

			printf("Enter number to multiply with (real part): ");
			scanf("%lf",&x);
			printf("Enter number to multiply with ( img part): ");
			scanf("%lf",&y);

			complex c = complex_create(x,y);
			display = complex_mult(display, c);
		}
	}
}








