Question: C Programming *Notice: I can only edit the part where it says in /* Your solution goes here */ the other part of the code

C Programming

*Notice: I can only edit the part where it says in /* Your solution goes here */ the other part of the code i can't touch it please the solution should be inside that part ad using the code provided

Question 1

Declare an array pizzasInStore of 3 PizzaIngredients elements.

#include #include

typedef struct PizzaIngredients_struct { char pizzaName[30]; char ingredients[70]; } PizzaIngredients;

int main(void) {

/* Your solution goes here */

strcpy(pizzasInStore[0].pizzaName, "Barbecue"); strcpy(pizzasInStore[0].ingredients, "Beef, chicken, bacon, barbecue sauce"); strcpy(pizzasInStore[1].pizzaName, "Carbonara"); strcpy(pizzasInStore[1].ingredients, "Mushrooms, onion, creamy sauce"); strcpy(pizzasInStore[2].pizzaName, "Ham and Cheese"); strcpy(pizzasInStore[2].ingredients, "Ham, cheese, bacon");

printf("%s: %s ", pizzasInStore[0].pizzaName, pizzasInStore[0].ingredients); printf("%s: %s ", pizzasInStore[1].pizzaName, pizzasInStore[1].ingredients); printf("%s: %s ", pizzasInStore[2].pizzaName, pizzasInStore[2].ingredients);

return 0; }

Question2

Write a statement that calls a function named AddToStock, passing the variable addStock. Assign mugInfo with the value returned by AddToStock.

#include #include

typedef struct ProductInfo_struct { char itemName[30]; int itemQty; } ProductInfo;

ProductInfo AddToStock (ProductInfo productToStock, int increaseValue) { productToStock.itemQty = productToStock.itemQty + increaseValue;

return productToStock; }

int main(void) { ProductInfo mugInfo; int addStock = 10;

scanf("%s", mugInfo.itemName); scanf("%d", &mugInfo.itemQty);

/* Your solution goes here */

printf("Name: %s, stock: %d ", mugInfo.itemName, mugInfo.itemQty);

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!