subject

A. Write out a structure called GroceryItem that contains two fields: a string (name) that contains the name of the grocery item and a float (cost) that stores the cost of the item. b. Write out how you would create a variable of type GroceryItem called apple. Write two more lines of code that would set apple’s name to "Granny Smith" and apple’s cost to 0.79.
c. Now, write out a line of code that would create an array of 20 GroceryItem structures called, inventory.
d. Write the two lines of code that would

i. set the name of 6th GroceryItem in the array, inventory, to be "Cheese"
ii. set the cost of the 11th GroceryItem in the array, inventory, to be 3.50.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 08:30
Linda subscribes to a cloud service. the service provider hosts the cloud infrastructure and delivers computing resources over the internet.what cloud model is linda using
Answers: 1
question
Computers and Technology, 22.06.2019 09:30
Is a string of code written to hurt others by damaging or destroying
Answers: 1
question
Computers and Technology, 22.06.2019 19:00
If your accelerator suddenly gets stuck what should you do
Answers: 2
question
Computers and Technology, 22.06.2019 21:40
Develop a function to create a document in the mongodb database “city” in the collection “inspections.” be sure it can handle error conditions gracefully. a. input -> argument to function will be set of key/value pairs in the data type acceptable to the mongodb driver insert api call b. return -> true if successful insert else false (require a screenshot)
Answers: 2
You know the right answer?
A. Write out a structure called GroceryItem that contains two fields: a string (name) that contains...
Questions
question
Biology, 18.03.2021 03:10
question
History, 18.03.2021 03:10
question
Social Studies, 18.03.2021 03:10
Questions on the website: 13722367