//******************************************************************************
//
// CS 240C : Spring 2003 Ohio University Travis Dillon
// Project 3 : Animal Homes
// file : bobcat.cc
// started : 05-07-03
//
//******************************************************************************
#include "bobcat.h"
Bobcat::Bobcat(int room, int phone, int comp, int cost)
{ //this c-tor is used when reading data from the file
//the Bobcat object is instantiated with the new call
id = 3;
num_room = room;
num_phone = phone;
num_comp = comp;
price = cost;
}
void Bobcat::input()
{ //user inputs all the attributes for the bat cave here
cout << "\nLet's make you a nice bobcat den."
<< "\nHow many rooms do you need in the den? ";
cin >> num_room;
cout << "How many phones would you like? ";
cin >> num_phone;
cout << "How many computers do you need? ";
cin >> num_comp;
price = set_price(num_room, num_phone, num_comp);
cout << "The total price will be $" << price;
}
void Bobcat::output()
{ //output when user wants to see all the homes ordered
cout << "\nBobcat den"
<< "\nnumber of rooms = " << num_room
<< "\nnumber of telephones = " << num_phone
<< "\nnumber of computers = " << num_comp
<< "\ntotal price = $" << price
<< endl;
}
void Bobcat::print(ofstream& fout)
{ //output member variables to output file to be read in on next start up
fout << num_room << endl
<< num_phone << endl
<< num_comp << endl
<< price << endl;
}
int Bobcat::set_price(int room, int phone, int comp)
{ //the actuall price of the home
return(room*10000 + phone*99 + comp*1500);
}