- Read in a file of complex numbers (126import.txt) and store them in an array o
ID: 3799864 • Letter: #
Question
- Read in a file of complex numbers (126import.txt) and store them in an array of complex objects. (Please include complex.h, complex.cpp and main.cpp)
- Create a menu to allow console add / delete / list and save functions.
Add: Allows user to append a new complex number into an array of complex numbers
Delete: Removes one complex number from an array of complex numbers either by selecting an index or by searching for a specific complex number
List: Prints out an array of complex numbers in ascending order according to magnitude onto the console
Save: Saves the array of complex numbers into a file
The magnitude of a complex number a+bi is sqrt(a*a+b*b).
Save function stores the results to file 126complex.txt
--------------------------------------------------------------------------------------
File: 126import.txt
1+1i
3.3+3.4i
4.4-4.5i
-5.5-5.6i
-6
7i
-8i
2+i