// @topic W15-1-030 class inheritance and pure interface
// @brief main driver program
#include <iostream>
#include <cstdlib>
#include <vector>
#include <memory>
#include <iomanip>
#include "shapes.h"
using namespace std;
int main()
{
double radius = 1.0;
double width = 1.0;
double height = 1.0;
Circle cir1( 2.3 );
Circle cir2( 4.5 );
cir1.get_area();
cir2.get_area();
//Rectangle rect( width, height );
vector< unique_ptr< IShape > > shapes;
shapes.push_back( unique_ptr< IShape >( new Circle( radius ) ) );
shapes.push_back( unique_ptr< IShape >( new Rectangle( width, height ) ) );
shapes.push_back( unique_ptr< IShape >( new Square( 3.3 ) ) );
double total_area = 0.0;
for ( unique_ptr< IShape > const& pshape : shapes ) {
total_area = total_area + pshape->get_area();
}
cout << "total area is " << fixed << total_area << "\n";
system( "pause" );
return 0;
}//main