-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathChicken_Sandwich.cpp
33 lines (27 loc) · 1.12 KB
/
Chicken_Sandwich.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#include "Chicken_Sandwich.h"
using namespace std;
//default behavior for chicken sandwich will call parent class constructor and fill in salad
Chicken_Sandwich::Chicken_Sandwich() : Sandwich("Chicken",
vector<string> {"Lettuce","Tomato","Mozzarella","Garlic Spread"},
false,
8.99) {
//class' protected instance field
has_salad = false;
}
//calls sandwich parent class and then adds its own additional field
//whether they got a salad on the side or not
//price is taken from the input value to the chicken sandwich constructor
Chicken_Sandwich::Chicken_Sandwich(vector<string> toppings, bool toasted, bool has_sal, double price) :
Sandwich("Chicken", toppings,toasted, price)
{
//class' protected instance field
has_salad = has_sal;
}
//setter for if the person ordered a salad or not
void Chicken_Sandwich::set_salad(bool has_salad) {
this->has_salad = has_salad;
}
//getter for if the person ordered a salad or not
bool Chicken_Sandwich::get_salad() {
return has_salad;
}