Question
Declare a vector named availablePizzas that stores 3 items of type PizzaIngredients. #include #include #include using namespace std; struct PizzaIngredients { string pizzaName; string ingredients;
Declare a vector named availablePizzas that stores 3 items of type PizzaIngredients.
#include
struct PizzaIngredients { string pizzaName; string ingredients; };
int main() {
/* Your solution goes here */
availablePizzas.at(0).pizzaName = "Barbecue"; availablePizzas.at(1).pizzaName = "Carbonara"; availablePizzas.at(2).pizzaName = "Ham and Cheese"; availablePizzas.at(0).ingredients = "Beef, chicken, bacon, barbecue sauce"; availablePizzas.at(1).ingredients = "Mushrooms, onion, creamy sauce"; availablePizzas.at(2).ingredients = "Ham, cheese, bacon";
cout << availablePizzas.at(0).pizzaName << ": " << availablePizzas.at(0).ingredients << endl; cout << availablePizzas.at(1).pizzaName << ": " << availablePizzas.at(1).ingredients << endl; cout << availablePizzas.at(2).pizzaName << ": " << availablePizzas.at(2).ingredients << endl;
return 0; }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started