Question

QUESTION 5 14 marks A bathroom warehouse keeps the following information for the items in stock: description(a string, for ex

5.2 Assume that an array Item stock [50] has been declared and that information for 50 items in stock has been stored in the

0 0
Add a comment Improve this question Transcribed image text
Answer #1
struct Item
{
 string description;
 string code;
 string color;
 int number;
 float price;
};

//line 2

total = 0;

//line 4

int i = 0; i <49; i++

//line 6

if( stock[i].color == "white" & stock[i].description == "bath" )
//line 8

cout<<stock[i].code<<endl;

//line 9

total++;

//line 11

cout<<total<<endl;

Add a comment
Know the answer?
Add Answer to:
QUESTION 5 14 marks A bathroom warehouse keeps the following information for the items in stock:...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • A bathroom warehouse keeps the following information for the items in stock: O description(a string, for...

    A bathroom warehouse keeps the following information for the items in stock: O description(a string, for example "bath”) codeto distinguish between items with the same description and color but of a different design (a string to store 6 digits, for example "123456") color(a string, for example "white") numberin stock (an integer, for example 49) price(a floating point number, e.g. 349.95) 5.1 Write down the declaration for a structfor storing the information associated with one kind of item in stock. Give...

  • A bathroom warehouse keeps the following information for the items in stock: description(a string, for example...

    A bathroom warehouse keeps the following information for the items in stock: description(a string, for example "bath”) codeto distinguish between items with the same description and color but of a different design (a string to store 6 digits, for example "123456") color(a string, for example "white") numberin stock (an integer, for example 49) price(a floating point number, e.g. 349.95) 5.2 Assume that an array Item stock [50] has been declared and that information for 50 items in stock has been...

  • 90% - e QUESTIONS T4 marks A bathroom warehouse keeps the following information for the items...

    90% - e QUESTIONS T4 marks A bathroom warehouse keeps the following information for the items in stock: description a string. For example "bath) codete distinguish between items with the same description and color but of a different design (a string to store 6 digits, for example "123456") colorfa string, for example "white") numberin stock (an integer, for example 49) O pricela floating point number, e 349.95) 5.1 Write down the dedaration for a struct for storing the information associated...

  • QUESTION 5 14 marks A bathroom warehouse keeps the following information for the items in stock:...

    QUESTION 5 14 marks A bathroom warehouse keeps the following information for the items in stock: [description(a string, for example "bath") [codeto distinguish between items with the same description and color but of a different design (a string to store 6 digits, for example "123456") [color(a string, for example "white") [ numberin stock (an integer, for example 49) [price(a floating point number, e.g. 349.95) 5.1 Write down the declaration for a structfor storing the information associated with one kind of...

  • QUESTIONS 14 marks A bathroom warehouse keeps the following information for the items in stock: o...

    QUESTIONS 14 marks A bathroom warehouse keeps the following information for the items in stock: o description(a string, for example "bath") O code to distinguish between items with the same description and color but of a different design (a string to store 6 digits, for example "123456") col or (a string, for example "white") Onunber in stock (an integer, for example 49) pri cela floating point number, e.g. 349.95) Write down the declaration for a struct for storing the information...

  • A bathroom warehouse keeps the following information for the items in stock: description(a string, for example...

    A bathroom warehouse keeps the following information for the items in stock: description(a string, for example "bath") codeto distinguish between items with the same description and color but of a different design (a string to store 6 digits, for example “123456") color(a string, for example "white") numberin stock (an integer, for example 49) price(a floating point number, e.g. 349.95) 5.1 Write down the declaration for a structfor storing the information associated with one kind of item in stock. Give the...

  • c++ question, i put the txt attachment picture for this question... please include comments on calculations...

    c++ question, i put the txt attachment picture for this question... please include comments on calculations and varibles Description In this program, you will write a program to emulate a vending machine (somewhat). In this version of the program, you will use a struct type defined below struct snackType string name; string code; double price; int remaining; Where name contains the snack's name, code contains the 2 digit code for the item, price holds the item's price, and remaining holds...

  • A school teacher has a list of leftover school supplies from previous semesters. The teacher woul...

    A school teacher has a list of leftover school supplies from previous semesters. The teacher would like to maintain an ordered list of the supplies. Write a program in C that reads in the data (a list of supplies in random order) from a file, orders the items by name, and writes the ordered list to the output file. Assume the input file has the format of color (one word string), name, followed by quantity (int) with each type of...

  • Assume that a restaurant offers the following breakfast items: Plain Egg $1.45 Bacon and Egg $2.45...

    Assume that a restaurant offers the following breakfast items: Plain Egg $1.45 Bacon and Egg $2.45 Muffin $0.99 French Toast $1.99 Fruit Basket $2.49 Cereal $0.69 Coffee $0.50 Tea $0.75 Write a program that stores the following data about each menu item in a structure called MenuItem: • A description of the menu item • The price of the menu item • A count of the number of times the item has been ordered
 The program should keep an array...

  • In C++ Programming Write a program in Restaurant.cpp to help a local restaurant automate its breakfast...

    In C++ Programming Write a program in Restaurant.cpp to help a local restaurant automate its breakfast billing system. The program should do the following: Show the customer the different breakfast items offered by the restaurant. Allow the customer to select more than one item from the menu. Calculate and print the bill. Assume that the restaurant offers the following breakfast items (the price of each item is shown to the right of the item): Name Price Egg (cooked to order)...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT