1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
vekshin1
2 years ago
5

Design and write an object-oriented program for managing inventory bins in a warehouse. To do this you will use two classes: Inv

Bin and BinManager. The InvBin class holds information about a single bin. The BinManager class will own and manage an array of InvBin objects. Here is a skeleton of what the InvBin and BinManager class declarations should look like:
class InvBin

{

private:

string description;

int qty;

public:

InvBin (string d = "empty", int q = 0)

{

description = d;

qty = q;

}

void setDescription(string d);

string getDescription() ;

void setQty(int q);

int getQty( ) ;

};



class BinManager

{

private:

InvBin bin[30];

int numBins;

public:

BinManager()

{

numBins = 0;

}

BinManager(int size, string d[], int q[])

{

}

string getDescription(int index);

int getQuantity(int index);

string displayAllBins();

bool addParts(int binIndex, int q);

bool removeParts(int binIndex, int q);

};
Computers and Technology
1 answer:
andrew11 [14]2 years ago
3 0

Answer:

#include <cstdlib>

#include <iostream>

using namespace std;

int main(int argc, char *argv[])

{

class InvBin {

private:

string description;

int qty;

 

public:

InvBin(){ description = ""; qty = 0;}

InvBin (string d, int q) { description = d; qty = q;}

void setDescription (string d){description = d;}

void setQty(int q){qty = q;}

string getDescription() {return description;}

int getQty(){ return qty; }

};

class BinManager {

private:

InvBin bin[30];

int numBins;

 

public:

BinManager() {numBins=0;}

BinManager(int size, string d[], int q[])

{

int i;

for(i=0; i<size; ++i)

{

bin[i].setDescription(d[i]);

bin[i].setQty(q[i]);

}

numBins = size;

}

void setDescription (int b, string d) {bin[b].setDescription(d); }

void setQty(int b, int q) { bin[b].setQty(q); }

string getDescription(int b) { return bin[b].getDescription();}

int getQty(int b) { return bin[b].getQty();}

bool addParts(int b, int q)

{

int temp;

if(q < 1)

return false;

else

{

temp = bin[b].getQty() + q;

bin[b].setQty(temp);

return true;

}

}

bool removeParts(int b, int q)

{

int temp;

if (q < 1 || bin[b].getQty() < q)

return false;

else

{

temp = bin[b].getQty() - q;

bin[b].setQty(temp);

return true;

}

string displayAllBins()

{

int i;

for(i=0;i<numBins;++i)

cout << i+1 << ". " << left<< setw(20) << bin[i].getDescription()

<< right << setw(4) << bin[i].getQty() << endl;

}

};

system("PAUSE");

return EXIT_SUCCESS;

}

Explanation:

You might be interested in
Using your own computer, give the name of the operating system that runs it and give examples of five legal file names. Then cre
Vika [28.1K]

Answer:

Name of Operating System: Ubuntu

Five legal file names:

inventory.txt

total.txt

NIKKAH.txt

Defaulter.txt

studenT.txt

Five illegal file names:

wel/come.txt

..

MY>note.txt

.

my<work.yxt

Explanation:

To fix the illegal name:

1. Remove the special character, so it becomes welcome.txt

2. Remove the double dot and rename using text characters

3. Remove the special character, so it becomes MYnote.txt

4. A file cannot be named using dot. So we rename to a textual name

5. Remove the special character, so it becomes mywork.txt

Some additional rule for naming of files legally in Unix is that, you cannot use a reserved word to name your file. Starting a file name with number is allowed. Starting a file name with dot make the file to be hidden.

7 0
3 years ago
What are some of the ways you can use bitlocker encryption? (choose all that apply?
nasty-shy [4]
Bitlocker Encryption can be used during the process of authenticating your computer with a TPM, during the process of authenticating your account with a USB flash drive, and most of the authentication through text messages.
3 0
3 years ago
) Perform error checking for the data point entries. If any of the following errors occurs, output the appropriate error message
emmainna [20.7K]

Answer:

In Python:

entry = input("Sentence: ")

while True:

   if entry.count(",") == 0:

       print("Error: No comma in string")

       entry = input("Sentence: ")

   elif entry.count(",") > 1:

       print("Error: Too many comma in input")

       entry = input("Sentence: ")

   else:

       ind = entry.index(',')+1

       if entry[ind].isnumeric() == False:

           print("Comma not followed by an integer")

           entry = input("Sentence: ")

       else:

           break

print("Valid Input")

Explanation:

This prompts the user for a sentence

entry = input("Sentence: ")

The following loop is repeated until the user enters a valid entry

while True:

This is executed if the number of commas is 0

<em>    if entry.count(",") == 0:</em>

<em>        print("Error: No comma in string")</em>

<em>        entry = input("Sentence: ")</em>

This is executed if the number of commas is more than 1

<em>    elif entry.count(",") > 1:</em>

<em>        print("Error: Too many comma in input")</em>

<em>        entry = input("Sentence: ")</em>

This is executed if the number of commas is 1

   else:

This calculates the next index after the comma

       ind = entry.index(',')+1

This checks if the character after the comma is a number

       if entry[ind].isnumeric() == False:

If it is not a number, the print statement is executed

<em>            print("Comma not followed by an integer")</em>

<em>            entry = input("Sentence: ")</em>

If otherwise, the loop is exited

<em>        else:</em>

<em>            break</em>

This prints valid input, when the user enters a valid string

print("Valid Input")

Note that: entry = input("Sentence: ") <em>is used to get input</em>

4 0
3 years ago
Can someone write me a design brief about a stadium​
Delicious77 [7]

Btw..which dtadium do u want cricket or football!?

3 0
2 years ago
Read 2 more answers
What is the reason that a modern electron microscope (TEM) can resolve biological images to the subnanometer level, as opposed t
zhannawk [14.2K]

Answer:

The correct answer to the following question will be "The wavelengths of the electron beams are also much shorter or less than illumination and visible light".

Explanation:

TEM seems to be a methodology of microscopy during which a pulse of electrons is transferred to create the effect through some kind of microscope, could approach biological objects at the sub-nanometer standard, as related to hundreds of nano-meters for either the absolute best microscope with super-resolution.

Also because of the electron beam's distances, they are still much shorter or smaller than daylight and infrared light, meaning that biological objects and artifacts can be resolved.

6 0
3 years ago
Other questions:
  • In this digital age of rapid communications, how can you justify the time it takes to stop and revise a message
    10·1 answer
  • How can a user view the options for Junk E-mail?
    11·2 answers
  • When he takes a picture, Simon freezes an action without blurring it, to show movement. Which type of photographer is he?
    9·2 answers
  • What are the importance of switches in our electron device
    15·1 answer
  • Why would you use quotation marks in a search string when conducting an internet search?
    12·1 answer
  • What are the characteristics of a severe storm
    12·1 answer
  • The Operating System is used to locate, move, and copy files.
    10·1 answer
  • Explain logic circuit​
    8·1 answer
  • What are the routes through with Virus transmitted into computer<br>system?​
    15·1 answer
  • You are testing a printer you just installed, so you use the operator panel on the printer to print a test page. Later, you use
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!