ECE220/MPx/Number.cpp
//toString function prints warning if to string function not overloaded
toString function prints warning if to string function not overloaded
toString function prints warning if to string function not overloaded
string Number::to_String(void){
	stringstream my_output;
	string Number_type_string = "";
	switch (NumberType){
		case REAL:
			Number_type_string = "REAL";
			break;
		case COMPLEX:
			Number_type_string = "COMPLEX";
			break;
		case RATIONAL:
			Number_type_string = "RATIONAL";
			break;
		default:
			Number_type_string = "UNDEFINED";
			break;
	}
	my_output << "Error: Number type ";
	my_output << Number_type_string;
	my_output << " does not have a valid to_String() method!!\n";
	string output_string = my_output.str();
	return output_string;
}
string Number :: to_String ( void ) { stringstream my_output ; string Number_type_string = " " ; switch ( NumberType ) { case REAL : Number_type_string = " " ; break ; case COMPLEX : Number_type_string = " " ; break ; case RATIONAL : Number_type_string = " " ; break ; default : Number_type_string = " " ; break ; } my_output << " " ; my_output << Number_type_string ; my_output << " \n " ; string output_string = my_output . str ( ) ; return output_string ; }
toString function prints warning if to string function not overloaded
toString function prints warning if to string function not overloaded