COS3711 ASSIGNMENT 2 (COMPLETE ANSWERS) 2024 - DUE 18 JULY 2024 COURSE ADVANCED PROGRAMMING (COS3711) INSTITUTION UNIVERSITY OF SOUTH AFRICA (UNISA) BOOK PYTHON ADVANCED PROGRAMMING EXAM QUESTIONS AND COMPLETE WELL EXPLAINED ANSWERS WITH RATIONALE 100%
COS3711 ASSIGNMENT 2 (COMPLETE ANSWERS) 2024 - DUE 18 JULY 2024 COURSE ADVANCED PROGRAMMING (COS3711) INSTITUTION UNIVERSITY OF SOUTH AFRICA (UNISA) BOOK PYTHON ADVANCED PROGRAMMING EXAM QUESTIONS AND COMPLETE WELL EXPLAINED ANSWERS WITH RATIONALE 100% VERIFIED AS CORRECT LATEST UPDATE 2024 GRADED A+[ALREADY PASSED] 2.1. The intention is to use reflective programming approaches. Write the class definition of the main container class so that reflective programming approaches can be used. It should be possible to create such container objects using a code that has already been provided; however, a default code (D999D) should be used if no code is provided when the object is instantiated. (9) 2.2. The client wants to be able to add a comment to some of the container objects but does not what this to be available as a general requirement for all container objects. Is it possible to add a comment like “Fragile” to a container object named container? If so, explain why and provide the code to do so; if not, explain in detail why not. Note that there are no marks allocated for answering yes or no. (3) 2.3. The following code is to be used to get property data from a container object. 1 QDomDocument d; 2 Container *c = new Container(); // assume a valid container 3 const QMetaObject *m = c-metaObject(); 4 QDomElement basetag = eElement("container"); 5 for (int i=1; im-propertyCount(); i++) 6 { 7 QMetaProperty prop = m-property(i); 8 QString propertyName = (); 9 QString propertyValue = (c).toString(); 10 QDomElement nametag = eElement(propertyName); 11 dChild(nametag); 12 QDomElement valuetag = eElement(propertyValue); 13 dChild(valuetag); 14 } It is intended that the following XML structure be produced. container 1st property namefirst property value/1st property name 2nd property namefirst property value/2nd property
Connected book
- april 2016
- 9781908682413
- 1
Written for
- Institution
- COS3711
- Course
- COS3711
Document information
- Uploaded on
- July 12, 2024
- Number of pages
- 12
- Written in
- 2023/2024
- Type
- Exam (elaborations)
- Contains
- Questions & answers
Subjects
-
cos3711 assignment 2
-
cos3711 assignment
-
cos3711
-
cos3711 assignment 2 complete answers 2024
-
cos3711 assignment 2 questions and answers