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 #include #include using namespace std;

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!