//----- Run() ------------------------------------------------------------------
ID: 3533259 • Letter: #
Question
//----- Run() --------------------------------------------------------------------------------------------------
// Opens "complex-in.txt" for reading and "complex-out.txt" for writing. Then reads an operation character (+ -
// * or /) and two Complex numbers from the file. Performs the operation on the two complex numbers and outputs
// the two complex numbers and the result to the output file.
//
// There is an end-of-file (eof) char at the end of the file, so use an eof loop to read the input file.
//
// PSEUDOCODE
// Define ifstream object fin and open "complex-in.txt" for reading.
// Define ofstream object fout and open "complex-out.txt" for writing.
// Define char variable operation.
// While reading a character from fin into operation succeeds Do
// Define double variables real1, imag1, real2, imag2.
// Read four doubles from fin into real1, imag1, real2, imag2.
// Define a Complex object c1 passing real1 and imag1 to the ctor.
// Define a Complex object c2 passing real2 and imag2 to the ctor.
// Define a Complex object result and call the default ctor.
// If operation is '+' Then
// Assign the return value from c1.Add(c2) to result.
// ElseIf operation is '-' Then
// Assign the return value from c1.Sub(c2) to result.
// ElseIf operation is '*' Then
// Assign the return value from c1.Mult(c2) to result.
// Else
// Assign the return value from c1.Div(c2) to result.
// End If
// Send to fout c1.ToString() ' ' operation ' ' c2.ToString() " = " result.ToString() endl.
// End While
// Close fin and fout.