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, 23.06.2019 09:00
Before you record your own voice, you should a. record other people's voices b. warm up and practice difficult names c. listen to your favorite songs d. read a transcript of a good radio news segment
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
After you present a proposal, the committee starts asking you questions, some beyond the strict focus of your proposal. they ask questions about implications in other fields and knowledge about other fields. you are asked to redo your proposal. what is most likely missing? breadth of material depth of material clarity of material details of material
Answers: 1
question
Computers and Technology, 23.06.2019 16:00
An english teacher would like to divide 8 boys and 10 girls into groups, each with the same combination of boys and girls and nobody left out. what is the greatest number of groups that can be formed?
Answers: 2
question
Computers and Technology, 24.06.2019 07:30
John recently worked on a project about various programming languages. he learned that though procedural language programs are useful, they have disadvantages too. what is a disadvantage of programs written in procedural languages? a. programs do not represent data complexity. b. programs take more time to execute. c. programs are prone to security threats. d. programs do not interface with multiple platforms.
Answers: 3
You know the right answer?
A. Write out a structure called GroceryItem that contains two fields: a string (name) that contains...
Questions
question
Mathematics, 20.09.2019 18:30
question
Social Studies, 20.09.2019 18:30
Questions on the website: 13722359