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
Consider the following protocol for concurrency control. The database system assigns each transaction a unique and strictly incr
nasty-shy [4]

Answer:

(a) yes, this protocol allows only serializable schedules for transactions as due to this the system maintains it's consistency. As in this protocol a unique transaction id is being assigned and with the help of that transaction id the system would be able to identify the process which has taken place in what particular order. For example, in case of bank transfers

balance = 1000 transaction id 100

write ADD 200 transaction id 101

write SUB 1100 transaction id 102

write ADD 900 transaction id 103

in here with the help of transaction id we can check which operation has happened in which order, if not then some operation will not happen like 102 immediately after 100 and skipping 101

(b) the modified version of this protocol would be to also consider the time of transaction and take this factor in the consideration

4 0
3 years ago
Session Hijacking refers to the exploitation of a valid computer session where an attacker takes over a session between two comp
noname [10]

Answer:Weak session ID generation algorithm

Explanation: Session hijacking is the hacking by disguising as the authenticated user and illegally exploit the particular computer session. IP packets are invoked by the disguised attacker into the active session between the legal computer user. It is also called session key.

It gives the hacker to use the data and services of the computer in an unauthorized manner. It arises due to the session of communication are not secure and strong,key used for session is weak etc.

5 0
2 years ago
Why were video games invented?
Alenkinab [10]
The answer is in the following website: https://www.reference.com/history/were-video-games-invented-e9413d3dc1378766


4 0
3 years ago
What is the nearest inhabited area to the amazon rainforest
TEA [102]
There are inhabited areas INSIDE the Amazon Rainforest. Many primitive tribes with little to no contact of the outside world live in remote areas of the rainforest, but the closest major city to the rainforest (also inside) is Manaus, Brazil.
4 0
3 years ago
Game development is a time-consuming and expensive endeavor, and being a Lone Ranger is a recipe for disaster
belka [17]
False although depends on the future of the person's ideas
7 0
3 years ago
Other questions:
  • Select the correct answer.
    7·2 answers
  • Encapsulation is the process of “packaging” information prior to transmitting it from one location to another. true or false
    14·1 answer
  • Which of the following is considered to be intellectual property?
    9·1 answer
  • Consider the following definition of the recursive function mystery. int mystery(int first, int last) { if (first &gt; last) ret
    12·1 answer
  • What major criteria must a product or process meet in order to be considered emerging technology?
    6·1 answer
  • Please complete the following questions. It is important that you use complete sentences and present the questions and answers w
    12·2 answers
  • tell us things u did as a kid but don't want to admit to it (best gets brainly 5 stasr and a thank you)
    13·2 answers
  • What is the output?
    7·1 answer
  • In Python, while loops will repeat during the time the test condition is true.
    7·2 answers
  • How has the internet improved business communication worldwide
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!