Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

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

Edit this C++ code 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

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

// user inputs cout > a; cout > c; cout > d; cout > e; cout

// ignore cin.ignore(); // description from user cin.getline(b, 40); cout > f;

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

// display data cout

return(0); }

image text in transcribed

O C:WINDOWSystem32\cmd.exe ============= =========== ========== ==== Office Supply Product Information = ======== ======== ======================= ================================ ======== ====== Identification Number: Description: Manufacturer: Wholesale Price: Mark-Up Percentage: Quantity In Stock: ======= ===========EEEEEEEE ======================== -Floppy Disks Office Supply Product Retail Price: $ 18.00 Ent pu wish to enter any more products

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Modeling And Design

Authors: Toby J. Teorey, Sam S. Lightstone, Tom Nadeau, H.V. Jagadish

5th Edition

0123820200, 978-0123820204

More Books

Students explore these related Databases questions

Question

2. Are my sources up to date?

Answered: 3 weeks ago