#include <iostream>
#include "Burger.h"
#include "Customer.h"
#include <cstdlib>
#include <ctime>
usingnamespace std;
int main()
{
srand(time(NULL));
constint NUM_BURGERS = 5;
constint NUM_PEOPLE = 5;
Burger burger_array[NUM_BURGERS];
Customer cust_array[NUM_PEOPLE];
for(int i = 0; i < NUM_BURGERS; i ++)
cout << burger_array[i];
for(int i = 0; i < NUM_PEOPLE; i ++)
cout << cust_array[i];
burger_array[0].setPathogen(true);
cust_array[0].eat(burger_array[0]);
cout << cust_array[0];
return 0;
}
There are several hundred lines that I didn't include here, but everything is for sure #include'd, I'm using namespace std;, and I keep getting poor output.
Krusty Saucy Single Overkill Kermit Burger
Patties: 1
Oz. of Bacon: 4
Num Pickles: 3
No Cheese
Has Sauce
Safe(ish)
Price: 4.6
Krusty Saucy Triumph Overkill Kermit Burger
Patties: 3
Oz. of Bacon: 4
Num Pickles: 3
No Cheese
Has Sauce
Safe(ish)
Price: 6.1
Krusty Mountain Wilbur Tasteless Burger
Patties: 4
Oz. of Bacon: 2
Num Pickles: 0
No Cheese
No Sauce
Safe(ish)
Price: 5
Krusty Cheesy Single Klogger Kermit Burger
Patties: 1
Oz. of Bacon: 3
Num Pickles: 3
Has Cheese
No Sauce
Safe(ish)
Price: 4.25
Krusty Mountain Bacon Kermit Burger
Patties: 4
Oz. of Bacon: 1
Num Pickles: 3
No Cheese
No Sauce
Safe(ish)
Price: 5.25
is alive, has a weight of 229 lbs and a cholesterol level of 240.
is alive, has a weight of 240 lbs and a cholesterol level of 198.
is alive, has a weight of 214 lbs and a cholesterol level of 277.
is alive, has a weight of 229 lbs and a cholesterol level of 177.
is alive, has a weight of 208 lbs and a cholesterol level of 268.
They died from the deadly pathogen!
is dead, has a weight of 232.85 lbs and a cholesterol level of 261.
Here is the overloaded cout <<:
1 2 3 4 5 6 7 8 9
ostream& operator<<(ostream &out, const Customer person)
{
cout << person.m_name << (person.m_alive ? " is alive," : " is dead,") <<
" has a weight of " << person.m_weight <<
" lbs and a cholesterol level of " <<
person.m_cholesterol << ".";
cout << endl;
return out;
}
Before each 'is alive . . .' there should be a name from my names.dat file.
They should be read sequentially into the array of 5 customers as they are constructed. (Thus, only the first 5 should be read, because only an array of 5, not 15, is constructed.)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
Marge Simpson
Homer Simpson
Bart Simpson
Lisa Simpson
Maggie Simpson
Ned Flanders
Crazy Cat Lady
Grandpa Simpson
Mayor Quimbyn
Milhouse Van Houten
Mr. Teeny
Drederick Tatum
Judge Snyder
Principal Skinner
Luigi