Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Array of structures Create a function called CreateArrayor Structure to create an array of structs called pizzasin Store with 3 fields: name, a string scalar

image text in transcribed

Array of structures Create a function called CreateArrayor Structure to create an array of structs called pizzasin Store with 3 fields: name, a string scalar with the name of the pizza, ingredients, a string scalar with the ingredients, and calories, a numeric variable with the total calories. The first itenm in pizzasin Store is associated with the "Barbecue" pizza, then "Carbonara pizza, and finally "Ham and Cheese" pizza In a "Barbecue" pizza, the ingredients are "Beet, chicken, bacon, barbecue sauce" and the calories equal an integer, which is an input parameter of the function CreateArrayOf Structure called numcalofBBQ In a "Carbonara" pizza, the ingredients are "Mushrooms, onion, creamy sauce" and the calories equal 5 calories less that the "Barbecue" pizza In a "Ham and Cheese" pizza, the ingredients are "Ham, cheese, bacon and the calories equal the "Barbecue" pizza Ex: > numberCalofBBQ 30; pizzas!nstore CreateArrayofstructure(numberCalofBBQ) pizzas!nstore 1x3 struct array with fields: name ingredients calories >> pizzasInstore.name ans - "Barbecue" "Carbonara" "Ham and Cheese" ans ans >> pizzasInStore.ingredients ans Beef, chicken, bacon, barbecue sauce" Mushrooms, onion, creamy sauce "Ham, cheese, bacon" ans ans >> pizzasInStore.calories ans - 30 ans 25 ans 30 Array of structures Create a function called CreateArrayor Structure to create an array of structs called pizzasin Store with 3 fields: name, a string scalar with the name of the pizza, ingredients, a string scalar with the ingredients, and calories, a numeric variable with the total calories. The first itenm in pizzasin Store is associated with the "Barbecue" pizza, then "Carbonara pizza, and finally "Ham and Cheese" pizza In a "Barbecue" pizza, the ingredients are "Beet, chicken, bacon, barbecue sauce" and the calories equal an integer, which is an input parameter of the function CreateArrayOf Structure called numcalofBBQ In a "Carbonara" pizza, the ingredients are "Mushrooms, onion, creamy sauce" and the calories equal 5 calories less that the "Barbecue" pizza In a "Ham and Cheese" pizza, the ingredients are "Ham, cheese, bacon and the calories equal the "Barbecue" pizza Ex: > numberCalofBBQ 30; pizzas!nstore CreateArrayofstructure(numberCalofBBQ) pizzas!nstore 1x3 struct array with fields: name ingredients calories >> pizzasInstore.name ans - "Barbecue" "Carbonara" "Ham and Cheese" ans ans >> pizzasInStore.ingredients ans Beef, chicken, bacon, barbecue sauce" Mushrooms, onion, creamy sauce "Ham, cheese, bacon" ans ans >> pizzasInStore.calories ans - 30 ans 25 ans 30

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

Databases Organizing Information Digital And Information Literacy

Authors: Greg Roza

1st Edition

1448805929, 978-1448805921

More Books

Students also viewed these Databases questions