Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advanced MySQL 8 Discover The Full Potential Of MySQL And Ensure High Performance Of Your Database

Authors: Eric Vanier ,Birju Shah ,Tejaswi Malepati

1st Edition

1788834445, 978-1788834445

Students also viewed these Databases questions

Question

What has been your desire for leadership in CVS Health?

Answered: 1 week ago

Question

Question 5) Let n = N and Y Answered: 1 week ago

Answered: 1 week ago

Question

c. What were you expected to do when you grew up?

Answered: 1 week ago

Question

4. Describe how cultural values influence communication.

Answered: 1 week ago

Question

3. Identify and describe nine cultural value orientations.

Answered: 1 week ago