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
Who are the founders of Microsoft?
vekshin1

Answer:

Bill Gates, Paul Allen

Explanation:

The two founders of the mega-tech giant are Bill Gates, and Paul Allen. Hope this helps!

8 0
4 years ago
Angelina, the outgoing student body president, has finished a report about the upcoming school election. She wants to add a bord
stepladder [879]

Answer: page background, page borders, color

Explanation: just did the assignment

4 0
3 years ago
Read 2 more answers
Ahem, so basically I added a extension on my SCHOOL chromebook, and I want to get rid of it because it keeps opening extra tabs
Vladimir [108]

Answer:

Look below.

Explanation:

Oof. That must suck. I think that all you have to do to remove the extension is to right click on it and press delete. Thn a thing should slide down from the top of the screen and say something like "are you sure" and then press yes. That should work...

4 0
4 years ago
Should spreadsheets be used to keep an address list for holiday cards?<br> YES<br> ONO<br> Hurry pls
kodGreya [7K]

Answer:

No

because spreadsheet is used for calculation not for writing address

5 0
2 years ago
12. Because Java byte code is the same on all computers, compiled Java programs a. are nonexistent b. must be re-compiled for ea
GenaCL600 [577]

Answer:

C) Highly portable

Explanation:

This means they can run on any computer or platform that supports Java without the need for recompillation.

This idea is popularly called WORA that is Write Once Run Anywhere.

Software Applications written in Java are compiled to bytcode (.class) which are intended to run on the Java Virtual Machine (JVM) irrespective of the architecture of the computer or device.

5 0
3 years ago
Other questions:
  • Which group on the Home Ribbon allows you to add shapes to a PowerPoint slide?
    10·2 answers
  • HURYY PLEASE and please be the right answer!!!with reasoning
    13·1 answer
  • Why do most programmers indent the conditionally executed statements in a decision structure?
    7·1 answer
  • What is the process called that occurs when you start up your computer? A Download B Restore C Boot D Copy
    12·2 answers
  • What was Pike's objective on his first expedition in 1805?​
    9·1 answer
  • Please help me!!!!!!!!
    5·2 answers
  • If anyone wants to ft heres the link
    6·1 answer
  • Explain why microcomputers are installed with TCP/IP protocols?​
    15·1 answer
  • what is the arrangement of various flash elements, such as the tools panel, control panel, property inspector and stage
    12·1 answer
  • Who is the founder of C language?​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!