Question: CSC 340.03+04+05 340.030 Sc FALL 2018 A.4-15 Points Memory Area 1: Environment Memory Area 2: Runtime stack Memory Area 3: Free-storeeData MIDTERM EXAM REVIEW cout


CSC 340.03+04+05 340.030 Sc FALL 2018 A.4-15 Points Memory Area 1: Environment Memory Area 2: Runtime stack Memory Area 3: Free-storeeData MIDTERM EXAM REVIEW cout using namespace std; a. in which memory area is this element stored? Why? b. The lifetime, begin & end, of this element? Why? year Which area: [1] 2] [3] (4a) [4b] [5 string year class PC public: Why is that area? PCO 0 PC(string name, string model, string type): name(name), model(model), type(type) string getlnfo0 const + this->model+"In."+ this->type; What is its lifetime and why? void setOwner(const string&owner) this->owner owner private static string pcType; string owner"N/A" ) string name "NIA" string model("N/A" string typef"NIA pcOwner Which area: [1] 12] [3] [4a] [4b] [S Why is that area? string PC:pcType "Desktop" PC buyDell(string& pcowner) f pcOwner"Dell Owner:"+pcOwner static PC dell"Del,"T7500","Precision Workstation" ) dell1.setownerf"Michael Jordan"); PC dell2( dell1 ) PC" dell3new PCf d ell2 ); What is its lifetime and why? dell3->setOwner(pcOwner) return dell3 string dellOwner("Michael Dell"J " dellPCs buyDell(dellowner) cout using namespace std; a. in which memory area is this element stored? Why? b. The lifetime, begin & end, of this element? Why? year Which area: [1] 2] [3] (4a) [4b] [5 string year class PC public: Why is that area? PCO 0 PC(string name, string model, string type): name(name), model(model), type(type) string getlnfo0 const + this->model+"In."+ this->type; What is its lifetime and why? void setOwner(const string&owner) this->owner owner private static string pcType; string owner"N/A" ) string name "NIA" string model("N/A" string typef"NIA pcOwner Which area: [1] 12] [3] [4a] [4b] [S Why is that area? string PC:pcType "Desktop" PC buyDell(string& pcowner) f pcOwner"Dell Owner:"+pcOwner static PC dell"Del,"T7500","Precision Workstation" ) dell1.setownerf"Michael Jordan"); PC dell2( dell1 ) PC" dell3new PCf d ell2 ); What is its lifetime and why? dell3->setOwner(pcOwner) return dell3 string dellOwner("Michael Dell"J " dellPCs buyDell(dellowner) cout
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
