Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Read in a file of complex numbers (sample is attached 126import.txt) and store them in an array of complex objects do not use vectors or

Read in a file of complex numbers (sample is attached 126import.txt) and store them in an array of complex objects do not use vectors or other data structures for this lab. (Would you be able to do either static or dynamic array?)

Create a menu to allow console add/delete/list and save functions. (You can also do load functions to make it more complete). The list and save function needs to print out the numbers in ascending order based on its magnitude. The value of a complex number a+bi is sqrt(a*a+b*b).

Save function stores the results to file 126complex.txt.

Note:

If you can not handle a few corner cases, e.g. the last 3 complex number, remove them and focus on the main part. You will not get the full grade, but at least you need to get some code working.

You need to implement operator overloading to compare complex numbers as well as stream insertion/extraction operators.

It is highly recommended that you implement TWO classes (complex and complexDB) for this lab. It will be a good foundation for future data structure practices.

126import.txt includes:

1+1i

2+2i

3.3+3.4i

4.4-4.5i

- 5.5-5.6i

- 6

7i

- 8i

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Current Trends In Database Technology Edbt 2006 Edbt 2006 Workshops Phd Datax Iidb Iiha Icsnw Qlqp Pim Parma And Reactivity On The Web Munich Germany March 2006 Revised Selected Papers Lncs 4254

Authors: Torsten Grust ,Hagen Hopfner ,Arantza Illarramendi ,Stefan Jablonski ,Marco Mesiti ,Sascha Muller ,Paula-Lavinia Patranjan ,Kai-Uwe Sattler ,Myra Spiliopoulou ,Jef Wijsen

2006th Edition

3540467882, 978-3540467885

More Books

Students also viewed these Databases questions