-
Notifications
You must be signed in to change notification settings - Fork 0
/
recipeWithPostInstructions.cpp
49 lines (39 loc) · 1.52 KB
/
recipeWithPostInstructions.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
// cpp file for RecipeWithPostInstructions class
#include "recipeWithPostInstructions.h"
RecipeWithPostInstructions::RecipeWithPostInstructions(){
name = "";
}
RecipeWithPostInstructions::RecipeWithPostInstructions(string name){
this->name = name;
}
RecipeWithPostInstructions::RecipeWithPostInstructions(string name, vector<string> ingredients){
this->name = name;
this->ingredients = ingredients;
}
RecipeWithPostInstructions::RecipeWithPostInstructions(string name, vector<string> ingredients, vector<string> instructions){
this->name = name;
this->ingredients = ingredients;
this->instructions = instructions;
}
RecipeWithPostInstructions::RecipeWithPostInstructions(string name, vector<string> ingredients, vector<string> instructions, vector<string> postInstructions){
this->name = name;
this->ingredients = ingredients;
this->instructions = instructions;
this->postInstructions = postInstructions;
}
void RecipeWithPostInstructions::setPostInstructions(vector<string> postInstructions){
this->postInstructions = postInstructions;
}
vector<string> RecipeWithPostInstructions::getPostInstructions(){
return postInstructions;
}
void RecipeWithPostInstructions::addPostInstruction(string postInstruction){
postInstructions.push_back(postInstruction);
}
void RecipeWithPostInstructions::printRecipe() const{
Recipe::printRecipe();
cout << "Post Instructions: " << endl;
for (int i = 0; i < postInstructions.size(); i++){
cout << postInstructions[i] << endl;
}
}