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
3 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]3 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
A palindrome is a string that reads the same both forward and backward. For example, the string madam is a palindrome. Write a p
miskamm [114]

Answer:

Explanation: Hey bro! Sorry to bother. But have any of your questions got deleted after posting them? I don't know why my question got deleted by a guy.

8 0
3 years ago
Public static String doSomething(String s) { final String BLANK = " "; //BLANK contains a single space String str = ""; //empty
storchak [24]

Answer:

D. It returns a String that is equivalent to s with all its blanks removed

Explanation:

3 0
3 years ago
Which of the following is true about driving on "bald" tires?
makkiz [27]

i think ur answer would be D: both A and B

8 0
3 years ago
I love the brainly update guys! :)
earnstyle [38]

Answer:

you mind if i take these points?

Explanation:

3 0
3 years ago
Read 2 more answers
The technology dealing with robots is called
Alisiya [41]
<h2> Robotics </h2>

Robotics is a field of engineering that deal with design and application of robots and the use of computer for their manipulation and processing. ... Robotics requires the application of computer integrated manufacturing, mechanical engineering, electrical engineering, biological mechanics, software engineering.

4 0
3 years ago
Other questions:
  • A custom date format set for a date/time field that contains the symbols mmm/dd/yy would display the date as ____.
    12·1 answer
  • 50 pts DO NOT ANSWER FOR POINTS
    9·1 answer
  • ​A(n) ________ database makes it possible to store information across millions of machines in hundreds of data centers around th
    14·1 answer
  • "The network layer is responsible for transferring packets of data from the A.Source computer to the destination computer on adj
    11·1 answer
  • Who invented the machine known as colossus?
    9·2 answers
  • Robert works in a call center and receives a call from Kathy. Kathy says she can no longer access the online reporting applicati
    13·1 answer
  • What is the output?
    13·1 answer
  • Select the correct answer. Which is the bottom-most layer in the OSI model?
    9·1 answer
  • Identify two real-world examples of problems whose solutions do scale well
    13·1 answer
  • 1. (A) What do you mean by computer? Discuss the use of<br> computer in daily life.
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!