IS 22B quiz 2 Nrite your name here now> Answer every question; if you do not kno
ID: 3903877 • Letter: I
Question
IS 22B quiz 2 Nrite your name here now> Answer every question; if you do not know, make your best guess #include using namespace std, Given the following beginning for a class: class Stockltem protected: string description; double cost public: ll this makes the functions that are coded later public 1. Write a default constructor for the class Stockitem 2. Write a copy constructor for the class Stockitem. 3. White a constructor that has two parameters and sets the values of description and cost to the values of the two parameters.Explanation / Answer
1) StockItem() { } 2) StockItem(const StockItem &other) { description = other.description; cost = other.cost; } 3) StockItem(string desc, double c) { description = desc; cost = c; }
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.