Question

90% - e QUESTIONS T4 marks A bathroom warehouse keeps the following information for the items in stock: description a string.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

✔Solution 5.1

struct Item
{
   string description;
   string code;
   string color;
   int number;
   double price;
};

✔Solution 5.2

int total;
   //initialize total
   total = 0;
   /*search through the array to find all white baths */
   for (int i = 0; i < 50; i++)//exammine all items
   {
       /*test if item is a white bath*/
       if (stock[i].description == "white bath") {
           /*print code for white baths*/
           cout << stock[i].code << endl;
           /*Determine the total number of white bath in the stock*/
           total += stock[i].number;
       }
   }
   /*Display total number of white baths in stock*/
   cout << "Total number of white baths in stock: " << total << endl;

//If you need any help regarding this solution.... please leave a comment.... thanks

Add a comment
Know the answer?
Add Answer to:
90% - e QUESTIONS T4 marks A bathroom warehouse keeps the following information for the items...
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
  • 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 struct for storing the information associated with one kind of...

  • 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...

  • 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...

  • 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...

  • 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...

  • 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)...

  • C++ Retailltem.h, Retailltem.cpp, Store.h, Store.cpp, and Driver.cpp. Description: Write a set of programs that holds data...

    C++ Retailltem.h, Retailltem.cpp, Store.h, Store.cpp, and Driver.cpp. Description: Write a set of programs that holds data about items in a retail store. Your submission should include 5 files, Retailltem.b, Retailltem.cpp, Store, Store.cpp, and Driver.cpp 1. Retailltem class: The class should have three member variables • description (a string, represent the item's name. A name contains space) quantity (an int, represent how many current available) price (a double, item's price) Member Functions Constructor with default argument get Description getQuantity getPrice setDescription...

  • Write a C++ program that prompts the user with the following menu options: Erase-ArrayContent Count-Words Quit...

    Write a C++ program that prompts the user with the following menu options: Erase-ArrayContent Count-Words Quit 1. For Erase-ArrayContent option, write complete code for the C++ function Erase described below. The prototype for Erase function is as follow: void Erase( int a[ ], int * N, int * Search-Element) The function Erase should remove all occurrences of Search-Element from the array al). Note that array a[ ] is loaded with integer numbers entered by the user through the keyboard. N...

  • Write a C++ program that prompts the user with the following menu options: [E]rase–ArrayContent [C]ount–Words [R]ev–Words...

    Write a C++ program that prompts the user with the following menu options: [E]rase–ArrayContent [C]ount–Words [R]ev–Words [Q]uit 1. For Erase–ArrayContent option, write complete code for the C++ function Erase described below. The prototype for Erase is as follows: void Erase( int a[ ], int * N, int * Search-Element ) The function Erase should remove all occurrences of Search-Element from the array    a[ ]. Note that array a[ ] is loaded with integer numbers entered by the user through the...

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
ADVERTISEMENT