Concept explainers
Bin Manager Class
Design and write an object -oriented
class InvBin
{
private:
string description; //Item name
int qty; // Quantity of items
// in this bin
public:
InvBin (string d = “empty”, int q = 0) // 2-parameter constructor
{ description = d: qty = q: } // with default values
// It will also have the following public member functions. They
// will be used by the BinManager class not the client program.
void setDescription(string d)
string getDescription()
void setQty(1nt q)
int getQty( )
};
class BinManager
{
Private:
InvBin bm[30]: // Array of InvBin objects
int numBins; // Number of bins
// currently 1n use
public:
BinManager() // Default constructor
{ numBins = 0; )
BinManager(int size, string d[], int q[]) //3-parameter constructor
{
//Receives number of bins in use and parallel arrays of item names
//and quantities. Uses this info. to store values in the elements
//of the bin array. Remember, these elements are InvBin objects.
}
// The class will also have the following public member functions:
string getDescription(int index) // Returns name of one item
int getQuantity{int index) // Returns qty of one item
bool addParts{int binlndex, int q) //These return true if the
bool removeParts(int binlndex , int q) //action was done and false
// if it could not be done
//see validation information
Client Program
Once you have created these two classes, write a menu-driven client program that uses a BinManager object to manage its warehouse bins. It should initialize it to use nine of the bins, holding the following item descriptions and quantities. The bin index where the item will be stored is also shown here.
1. regular pliers 25 | 2. n. nose pliers 5 | 3. screwdriver 25 |
4. p. head screw driver 6 | 5. wrench-large 7 | 6. wrench-small 18 |
7. drill 51 | 8. cordless drill 16 | 9. hand saw 12 |
The modular client program should have functions to display a menu, get and validate the user's choice, and carry out the necessary activities to handle that choice. This includes adding items to a bin, removing items from a bin, and displaying a report of all bins. Think about what calls the displayReport client function will need to make to the BinManager object to create this report. When the user chooses the “Quit” option from the menu, the program should call its displayReport function one last time to display the final bin information. All 1/0 should be done in the client class. The BinManager class only accepts information, keeps the array of InvBin objects up to date, and returns information to the client program.
Input Validation: The BinManager class functions should not accept numbers less than 1 for the number of parts being added or removed from a bin. They should also not allow the user to remove more items from a bin than it currently holds.
Want to see the full answer?
Check out a sample textbook solutionChapter 8 Solutions
Starting Out with C++: Early Objects (9th Edition)
Additional Engineering Textbook Solutions
Starting Out with Python (4th Edition)
Java: An Introduction to Problem Solving and Programming (8th Edition)
Web Development and Design Foundations with HTML5 (8th Edition)
Starting Out with Programming Logic and Design (5th Edition) (What's New in Computer Science)
Database Concepts (8th Edition)
Computer Science: An Overview (13th Edition) (What's New in Computer Science)
- Please original work select a topic related to architectures or infrastructures (Data Lakehouse Architecture). Discussing how you would implement your chosen topic in a data warehouse project Please cite in text references and add weblinksarrow_forwardPlease original work What topic would be related to architectures or infrastructures. How you would implement your chosen topic in a data warehouse project. Please cite in text references and add weblinksarrow_forwardWhat is cloud computing and why do we use it? Give one of your friends with your answer.arrow_forward
- What are triggers and how do you invoke them on demand? Give one reference with your answer.arrow_forwardDiscuss with appropriate examples the types of relationships in a database. Give one reference with your answer.arrow_forwardDetermine the velocity error constant (k,) for the system shown. + R(s)- K G(s) where: K=1.6 A(s+B) G(s) = as²+bs C(s) where: A 14, B =3, a =6. and b =10arrow_forward
- • Solve the problem (pls refer to the inserted image)arrow_forwardWrite .php file that saves car booking and displays feedback. There are 2 buttons, which are <Book it> <Select a date>. <Select a date> button gets an input from the user, start date and an end date. Book it button can be pressed only if the start date and ending date are chosen by the user. If successful, it books cars for specific dates, with bookings saved. Booking should be in the .json file which contains all the bookings, and have the following information: Start Date. End Date. User Email. Car ID. If the car is already booked for the selected period, a failure message should be displayed, along with a button to return to the homepage. In the booking.json file, if the Car ID and start date and end date matches, it fails Use AJAX: Save bookings and display feedback without page refresh, using a custom modal (not alert).arrow_forwardWrite .php file with the html that saves car booking and displays feedback. Booking should be in the .json file which contains all the bookings, and have the following information: Start Date. End Date. User Email. Car ID. There are 2 buttons, which are <Book it> <Select a date> Book it button can be pressed only if the start date and ending date are chosen by the user. If successful, book cars for specific dates, with bookings saved. If the car is already booked for the selected period, a failure message should be displayed, along with a button to return to the homepage. Use AJAX: Save bookings and display feedback without page refresh, using a custom modal (not alert). And then add an additional feature that only free dates are selectable (e.g., calendar view).arrow_forward
- • Solve the problem (pls refer to the inserted image) and create line graph.arrow_forwardwho started the world wide webarrow_forwardQuestion No 1: (Topic: Systems for collaboration and social business The information systems function in business) How does Porter's competitive forces model help companies develop competitive strategies using information systems? • List and describe four competitive strategies enabled by information systems that firms can pursue. • Describe how information systems can support each of these competitive strategies and give examples.arrow_forward
- Microsoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT