//******************************************************************************
//
// CS 240C   : Spring 2003 Ohio University Travis Dillon
// Project 3 : Animal Homes
// file      : bear.cc
// started   : 05-07-03
//
//******************************************************************************

#include "bear.h"

Bear::Bear(int bed, int clock, int cost, int feet)
{  //this c-tor is used when reading data from the file
   //the Bear object is instantiated with the new call
   id = 2;
   num_bed = bed;
   num_clock = clock;
   price = cost;
   sq_feet = feet;
}

void Bear::input()
{  //user inputs all the attributes for the bear cave here
   cout << "\nLet's make you a nice bear cave."
        << "\nHow many sqare feet does the cave need to be?  ";
   cin >> sq_feet;
   cout << "How many beds do you need in the cave?  ";
   cin >> num_bed;
   cout << "How many alarm clocks do you need?  ";
   cin >> num_clock;
   price = set_price(num_bed, num_clock, sq_feet);
   cout << "The total price will be $" << price;
}

void Bear::output()
{  //output when user wants to see all the homes ordered
   cout << "\nBear cave"
        << "\nsquare footage = " << sq_feet
        << "\nnumber of beds = " << num_bed
        << "\nnumber of clocks = " << num_clock
        << "\ntotal price = $" << price
        << endl;
}

void Bear::print(ofstream& fout)
{  //output member variables to output file to be read in on next start up
   fout << num_bed << endl
        << num_clock << endl
        << price << endl
        << sq_feet << endl;
}

int Bear::set_price(int bed, int clock, int feet)
{  //the actuall price of the home
   return(feet*10 + bed*156 + clock*19);
}