Question: USING C# implement a product class to model products for an inventory management system. The header file product.h has been provided for you. You must

USING C#

implement a product class to model products for an inventory management system. The header file product.h has been provided for you. You must write the implementation file for this class. For this assignment, you must use the naming convention from the header file provided. We will be integrating this code into a GUI, so your variable and method names need to conform to the header provided. Your product class needs the following protected member variables: A static integer for the number of product instances created by your program. This integer should be initialized to 0, increment in all of your class constructors, and decrement in your class destructor. A string for the manufacturer of the product A string for the model of the product An integer for the Universal Product Code (UPC) of the product A double for the wholesale price of the product A double for the retail price of the product Your product class needs the following public methods: A default constructor A constructor that takes values for manufacturer, model, UPC, wholesale price, and retail price

A destructor A static method named get_num_products() that returns the value of the static variable num_products as an integer A method named get_profit() that returns the profit margin for the product as a double. A products profit margin is its wholesale price subtracted from its retail price A friend function that overloads the << operator. This function should take an ostream variable by reference and a product variable by reference as arguments. It should return an ostream by reference. This function should be implemented in the C# file that contains your main() function. It should print the values of a product to the console. You also need to write a C# file containing a main() function that includes your product class. You will implement the friend function that overloads the << operator for your product class in this file. You should also test all of the methods of your product class in your main() function. Add comments explaining each of your tests in your source code.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!