Question
I need all this in C++ and I need a Product.h file and a Product.cpp file. The Product class stores information relevant to a product.
I need all this in C++ and I need a Product.h file and a Product.cpp file.
The Product class stores information relevant to a product. These include product ID (integer), name, description, model (string), price, quantity, UPC (string), product dimensions (Dimensions object), and brand (Manufacturer object). Brand should be declared as a constant. Also include a static variable productCount. Each time a product is created, the product count should increase by 1.
The Product class should have 3 constructors: (1) a default constructor; (2) a constructor that accepts the product ID, name, description, price, quantity, upc, dimensions and manufacturer, (3) a constructor that accepts the product ID, name, description, model, price, quantity, upc, dimensions and manufacturer.
Create accessor and mutator functions for each of the data members. Also create the following functions: printManufacturerDetails, printProduct, printShortProduct, sellItem, returnItem and getProductCount. The table below describes each function.
This is the table:
Function | Description |
printManufacturerDetails | Prints all the details of the manufacturer |
printProduct | Prints all the product details |
printShortProduct | Prints the short version of the product. Product ID, Name, Manufacturer name, and price should be displayed |
sellItem | Selling an item reduces it quantity. This function should return true or false if the sale was successful |
returnItem | Returning an item increases the quantity of an item. |
getProductCount | Returns the value of the static member variable |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started