Question: Edit this Code of C++ to show the output as well. #include #include using namespace std; class Product { private: // private variables int id_number;

Edit this Code of C++ to show the output as well.

#include #include

using namespace std;

class Product { private:

// private variables int id_number; char pDescription[40]; int mId; double productPrice; double productMarkUp; int qty;

public:

// constructor Product() { id_number = 0; strcpy_s(pDescription, ""); mId = 0; productPrice = 0.0; productMarkUp = 0.0; qty = 0; }

// constructor with arguments Product(int a, char *b, int c, double d, double e, int f) { id_number = a; strcpy_s(pDescription, b); mId = c; productPrice = d; productMarkUp = e; qty = f; }

// setter functions void setID(int a) { id_number = a; } void setDescription(char *a) { strcpy_s(pDescription, a); } void setMId(int a) { mId = a; } void setProductPrice(double a) { productPrice = a; } void setProductMarkUp(double a) { productMarkUp = a; } void setQty(int a) { qty = a; }

// getter functions int getID() { return(id_number); } char* getDescription() { return(pDescription); } int getMId() { return(mId); } double getProductPrice() { return(productPrice); } double getProductMarkUp() { return(productMarkUp); } int getQty() { return(qty); }

// print Product data void print() { cout << "The Product's Identification Number: " << id_number; cout << " The Product's Manufacture's 'Identification Number: " << mId; cout << " The Product's Wholesale Price: " << productPrice; cout << " The Product's Mark-Up Percentage: " << productMarkUp; cout << " The Product's Description: " << pDescription; cout << " The Quantity Of The Product In Stock: " << qty; } };

// main int main() { int a; char b[40]; int c; double d, e; int f;

// user inputs cout << "Enter The Product's Identification Number: "; cin >> a; cout << "Enter The Product's Manufacture's 'Identification Number: "; cin >> c; cout << "Enter The Product's Wholesale Price: "; cin >> d; cout << "Enter The Product's Mark-Up Percentage: "; cin >> e; cout << "Enter The Product's Description: ";

// ignore cin.ignore(); // description from user cin.getline(b, 40); cout << "Enter The Quantity Of The Product In Stock: "; cin >> f;

// product object Product product(a, b, c, d, e, f);

// display data cout << " Display Result : - "; product.print();

return(0); }

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!