// Filename: Mega.h
// Author: G. Safko  <greg.safko@gmail.com>
// CS&P Lab Lecture
// Description: The Meg Number Class File
// Date Written: March 28, 2005
// Last Changed: March 28, 2005
 

#ifndef MEGA_H
#define MEGA_H

#include <string>
#include <iostream>

using namespace std;

class Mega
{
private:
	double mantissa;
	int exponent;

public:
	Mega( );				// Default constructor; sets everything to 0
	Mega(double m, int e);	// sets the object to m X 10 e
	Mega(string s);			// parses string s, and puts the proper data into mantissa and exponent


	//Accessors:
	char getSign( );                // returns the sign of the number, in char format
	char getExpoSign( );           	// returns the sign of the exponent, in char format
	int getNumber( );               // returns the whole number portion of the mantissa
	double getMantissa( );        	// returns the mantissa
	int getExponent( );             // returns the exponent
	void printMegaNumber( ); 		// prints the number in the format similar to a variable of type long double 
	long double getMegaNumber( );  	// returns the number in long double format
	string toString();				// returns the number ins string format

	//Mutators:
	void setMantissa(int);         	// sets the mantissa
	void setExponent(int);        	// sets the exponent
	void Normalize(void);           // normalizes the number, if necessary
	void add(Mega m);             	// adds m (of type Mega) to the object       
	void subtract(Mega m);      	// subtracts m (of type Mega) from the object   
	void multiply(Mega m);      	// multiplies m (of type Mega) by the object, and stores it in the object   
	void divide(Mega m);          	// divides the object by m (of type Mega), and stores it in the object   
 


};

#endif
