Question: I have programming homework to write a code for an online shop, the questions in the homework tells me what to do step by step

I have programming homework to write a code for an online shop, the questions in the homework tells me what to do step by step but I reached to a question where they asked me :how can I write a code for a private pointer attribute in class X to an object of class Z. and I couldn't answer bellow is the code so far:

#include #include #include using namespace std; //ANSWER 1 class Article { private: string model; double netPrice; double taxRate; public: Article(string m, double n, double t=19) { model.assign(m); netPrice=n; taxRate=t; } virtual~Article() { cout<<"~Article deleted"<

{ set_model(m); set_netPrice(n); original=o; } virtual ~Accessory() { cout<<"~Accessory"<

} }; //ANSWER 3 enum class OperatingSystem { unknown, android, iOS, macOS, linux, proprietary, unix, windows }; ostream& operator<<(ostream& out, const OperatingSystem& os) { string osS; switch(os) { case OperatingSystem::unknown: { osS="unknown OS"; break; } case OperatingSystem::android: { osS="Android OS"; break; } case OperatingSystem::iOS: { osS="iOS"; break; } case OperatingSystem::macOS: { osS="MacOS"; break; } case OperatingSystem::proprietary: { osS="proprietary OS"; break; } case OperatingSystem::unix: { osS="Unix OS"; break; } case OperatingSystem::linux: { osS="linux OS"; break; } case OperatingSystem::windows: { osS="MS Windows OS"; break; } } } //ANSWER 4 class Device : public Article { private: int main_memory; string os; public: Device(string m,double n,int mm,double t,string ops=unknown):Article(string m,double n, double t) { set_model(m); os.assign(ops); set_netPrice(n); main_memory=mm; } virtual ~Device() { cout<<"~device()"<

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!