100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

COS3711 EXAM PACK 2025 - DISTINCTION GUARANTEED

Rating
-
Sold
15
Pages
166
Grade
A+
Uploaded on
29-01-2025
Written in
2024/2025

Well-structured COS3711 EXAM PREPARATION PACK - DISTINCTION GUARANTEED. Contains recent exam questions and answers, and Summarised study notes. All you need to pass the 2025 EXAMS

Institution
Module











Whoops! We can’t load your doc right now. Try again or contact support.

Connected book

Written for

Institution
Module

Document information

Uploaded on
January 29, 2025
Number of pages
166
Written in
2024/2025
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

COS3711
EXAM PACK
 Recent exam questions and answers

 Summarised study notes

 Exam tips and guidelines


+27 81 278 3372
DISCLAIMER & TERMS OF USE
1. Educational Aid: These study notes are designed to serve as educational aids and should not be considered as a
substitute for individual research, critical thinking, or professional guidance. Students are encouraged to
conduct their own extensive research and consult with their instructors or academic advisors for specific
assignment requirements.
2. Personal Responsibility: While every effort has been made to ensure the accuracy and reliability of the
information provided in these study notes, the seller cannot guarantee the completeness or correctness of all
the content. It is the responsibility of the buyer to verify the accuracy of the information and use their own
judgment when applying it to their assignments.
3. Academic Integrity: It is crucial for students to uphold academic integrity and adhere to their institution's
policies and guidelines regarding plagiarism, citation, and referencing. These study notes should be used as a
tool for learning and inspiration, but any direct reproduction of the content without proper acknowledgment and
citation may constitute academic misconduct.
4. Limited Liability: The seller of these study notes shall not be held liable for any direct or indirect damages,
losses, or consequences arising from the use of the notes. This includes, but is not limited to, poor grades,
academic penalties, or any other negative outcomes resulting from the application or misuse of the information
provide

]

, UNIVERSITY EXAMINATIONS




January/February 2022

COS3711

Advanced Programming

80 Marks

Duration 2 Hours

EXAMINERS:
FIRST: DR CL PILKINGTON
SECOND: MR K HALLAND
EXTERNAL: DR L MARSHALL (UNIVERSITY OF PRETORIA)

This paper consists of 6 pages.
Instructions
1. You may type your answers in a word processor (and then print to PDF for submission) or
handwrite your answers (and then scan to PDF).
2. Answer all questions. Please answer questions in order of appearance.
3. The mark for each question is given in brackets next to each question.
4. Note that no pre-processor directives are required unless specifically asked for.
5. Students must upload their answer scripts in a single PDF file (answer scripts must not be
password protected or uploaded as “read only” files)
6. NO emailed scripts will be accepted.
7. Students are advised to preview submissions (answer scripts) to ensure legibility and that the
correct answer script file has been uploaded.
8. Students are permitted to resubmit their answer scripts should their initial submission be
unsatisfactory. However, only three submissions are allowed.
9. Incorrect file format and uncollated answer scripts will not be considered.
10. Incorrect answer scripts and/or submissions made on unofficial examinations platforms will not
be marked and no opportunity will be granted for resubmission.
11. The mark awarded for an incomplete or illegible scanned submission will be the student’s final
mark. No opportunity for resubmission will be granted.
12. Submissions will only be accepted from registered student accounts.
13. Students who do not utilise the required invigilation or proctoring tools (IRIS) will be subjected to
disciplinary processes.
14. Students suspected of dishonest conduct during the examinations will be subjected to
disciplinary processes. UNISA has zero tolerance for plagiarism and/or any other forms of
academic dishonesty.
15. Students are provided one hour to submit their answer scripts after the official examination time.
Submissions made after the official examination time will be rejected by the examination
regulations and will not be marked.
16. Students experiencing network or load shedding problems are advised to apply, together with
supporting evidence, for an aegrotat within 3 days of the examination session.
17. Students experiencing technical problems should contact the SCSC on 080 000 1870 or email
or refer to Get-Help for the list of additional contact numbers.
Communication received from your myLife account will be considered.
Remember to complete the Honesty Declaration when submitting your answers. By
submitting your answers you are confirming that your submission is your own, unaided work.




This study source was downloaded by 100000894283260 from CourseHero.com on 01-28-2025 23:57:22 GMT -06:00 [TURN OVER]

https://www.coursehero.com/file/146195459/COS3711-2022-JanFeb-Question-paper-1pdf/

, 2 COS3711
January/February 2022

Transporting cargo around the world is essential in ensuring that customers have access to the
goods they need and want.
All such items are packaged in some sort of container (which, for the purposes of this scenario,
has some volume). Generally, there are two kinds of containers: (i) a box (where we want to
know whether it is cube shaped or not), and (ii) a cylinder (where we want to know its diameter).
For transport, containers are packed onto pallets, and pallets are then included in a load (where
each load will have a code).

Question 1 [24 marks]

1.1 Considering the scenario given above, draw a partial UML class diagram that captures
the scenario. You should include the necessary classes, class attributes, and class
relationships that are mentioned in the scenario. You do not have to include the
Client/GUI class nor indicate constructors, access specifiers, or other methods in the
classes you specify.
[You may use a software tool to create the UML class diagram.] (14)

1.2 Would you use aggregation or composition relationships in the design of this UML class
diagram? Explain why you have or have not done so. (2)

1.3 The load code takes the following format.
• Year value between 2000 and 2099 (both included)
• Forward slash (/)
• Month value between 01 and 12 (both included)
• Forward slash (/)
• L
• A serial number starting from 1, running up to 9999
Write the regular expression (in quotes) that can be used to check that a load code meets
the required criteria. An example of a valid code is 2022/01/L1. Ensure that you use
escape characters correctly. (8)

Question 2 [40 marks]

The intention is to serialise container objects using reflective programming approaches. The
idea is to convert all object data in a load to XML and save this data on a network store.

2.1 What is the major benefit of using a reflective approach in this scenario? (2)

2.2 For a container object that is urgent, the users want to add a property to just this specific
object. In such cases, the property name is urgent and its value is a message indicating
its priority (such as high priority). Assuming that the classes are set up to allow this
ability, write the code to implement this intention for an object named obj.
[Note that this approach can be used to add other optional properties to other objects
where necessary.] (2)

2.3 Consider the requirement to serialise the load class to and from XML.

2.3.1 The following UML class diagram for the serialisation has been provided (where the
QString is the XML text) for some Load class.

This study source was downloaded by 100000894283260 from CourseHero.com on 01-28-2025 23:57:22 GMT -06:00 [TURN OVER]

https://www.coursehero.com/file/146195459/COS3711-2022-JanFeb-Question-paper-1pdf/

, 3 COS3711
January/February 2022




It has been argued that this is incorrect. Provide a better UML class diagram. (3)

2.3.2 The following partial class definition has been provided to achieve the write part of the
serialisation using DOM to write to XML.
class XmlHandler
{
public:
XmlHandler();
QString writeXml(Load load);
private:
QDomDocument doc;
};

The intension is to provide the following XML code. Comments on the right are for
explanatory purposes.

<Load code="2021/01/L1"> the load code is included
<Pallet> all containers on the pallet are added
<Box urgent="High priority"> the type of container with message
<volume>1</volume> all properties with values
<cube>true</cube>
</Box>
<Cylinder> next container
<volume>3</volume>
<diameter>3</diameter>
</Cylinder>
</Pallet>
<Pallet> next pallet in the load
<Box>
<volume>2</volume>
<cube>false</cube>
</Box>
<Cylinder>
<volume>4</volume>
<diameter>4</diameter>
</Cylinder>
</Pallet>
</Load>



This study source was downloaded by 100000894283260 from CourseHero.com on 01-28-2025 23:57:22 GMT -06:00 [TURN OVER]

https://www.coursehero.com/file/146195459/COS3711-2022-JanFeb-Question-paper-1pdf/

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Edge
Follow You need to be logged in order to follow users or courses
Sold
9686
Member since
2 year
Number of followers
4252
Documents
2679
Last sold
18 hours ago

4.2

1179 reviews

5
665
4
236
3
178
2
27
1
73

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions