Question

A bathroom warehouse keeps the following information for the items in stock: O description(a string, for example bath”) code5.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

check out the solution.

--------------------------------

int total;
total = 0; // initialise total
// search through array to find all white baths
for(int i=0; i<50; i++)
{
if(stock[i].description = "bath" && stock[i].color = "white") // test if item is a white bath
{
cout << "\nCode : " << stock[i].code; // print the codes for white baths
total = total + 1; // determine the total number of white baths in stock
}
cout << "\nTotal number of white baths in stock : " << total; // display total number of white baths in stock

==================================

Add a comment
Know the answer?
Add Answer to:
A bathroom warehouse keeps the following information for the items in stock: O description(a string, for...
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: 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...

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

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

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

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

  • In C++ General Description: For this project, you will write a program that keeps track of...

    In C++ General Description: For this project, you will write a program that keeps track of inventory for a camera store. The data is located in the file Inventory.txt on the S:\ drive. While the program is running, the information should be stored in a linked list. 1. The information for each item will be stored in a struct a. The definition will be in a separate file called item.h 2. The total inventory will be stored in a linked...

  • C++ Program - Arrays- Include the following header files in your program:     string, iomanip, iostream Suggestion:...

    C++ Program - Arrays- Include the following header files in your program:     string, iomanip, iostream Suggestion: code steps 1 thru 4 then test then add requirement 5, then test, then add 6, then test etc. Add comments to display assignment //step 1., //step 2. etc. This program is to have no programer created functions. Just do everything in main and make sure you comment each step. Create a program which has: 1. The following arrays created:                 a. an array...

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

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