Question: 1 . Write a C + + code that has a class named Product . The class Product should have the following attributes: int product
Write a C code that has a class named "Product The class Product should have the following attributes: int product id; string name; float price, quantity, discount; Write a default constructor, a destructor, and a constructor function that initializes the object. Your destructor function should display the message "Object is destroyed. Your class should have function named showproduct that displays product id name,quantity,price and discount information. Your class should have a member function named "calculateprice Calculateprice function should calculate the total price considering the quantity, price and discount of the product. In your main program, create array of "Product" objects. Your array size should be Initialize the following objects using the constructor function: Product Id Discount Product Name Mirror Frame Oil Paint Canvas Brush Quantity Price After you initialize the objects, display the products' information using showproduct function. And display the total price for the products using the member function "calculateprice The product's stock information is as follows: Id: Name: Mirror Quantity: Price: $ Discount : The total price for the Mirror is : $ The product's stock information is as follows: Id: Name: Frame Quantity: Price: $ Discount : The total price for the Frame is : $ The product's stock information is as follows: Id: Name: Brush Quantity: Price: $ Discount : The total price for the Brush is : $ Object is destroyed. Object is destroyed. Object is destroyed. Object is destroyed. Object is destroyed.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
