COS3711 2024 Assignment 1
COS3711 2024 Assignment 1
COS3711 2024 Assignment 1
Advanced Programming
COS3711
Year module
Assignment 1 Questions
BARCODE
1
COS3711/Assignment 1/2024
Assignment 1
1. Introduction
Please use CMake (and not qmake) when setting up your assignment projects.
Qt Designer should not be used to design user interfaces, and you are expected to manually set
up GUIs to ensure that you properly handle memory using Qt’s parent-child functionality.
2. Questions
Question 1
Write classes (as necessary, remembering to avoid any anti-patterns) that will manage software
review data. The data itself consists of
• the name of the software,
• the date of the review, and
• an indication of whether it is recommended or not.
You should create a graphical user interface that allows a user to enter the data. Data should be
stored in an appropriate container (allowing for several reviews to be recorded), and be printed to a
console window when required.
Test your code by adding at least 3 pieces of data. Below is an example of a possible interface.
Question 2
Extend Question 1 so that it uses reflective programming techniques to access the data members of
the object that holds the review data. Write another display function that does not use any public
accessor functions (or a toString() function) to get access to the review data. Also add a button to
display the review detail to the application window (so that the program now can print to the
console or GUI window).
When displaying the data to the application window, you cannot assume that you know beforehand
how many properties there are, what they are called, or of what type they are. You need to loop
through the properties and using reflective programming techniques, display the data to the
application window.
Question 3
Use Qt’s model/view framework to store and display music CD information. The following
information should be stored in the model (a QStandardItemModel):
• composer,
• album name,
• replacement value, and
• a rating (out of 100).
The information should be displayed in a table.
Write an application that uses regular expressions to check for telephone numbers and email
addresses in a text file provided by a user. The following functionality should be included.
• The user should be able to select the file to check using a standard file open dialog
box.
• The file should be displayed in the GUI.
• The telephone numbers and email addresses should be highlighted/emphasized in
some way in the text.
An email address can be identified by a single @ symbol in the address; telephone numbers could
be from any of the following formats:
• 000-000-0000
• 000-0000000
• 0000000000
• (000)000-0000
• (000)0000000
You may assume that the email addresses and telephone numbers are free standing, that is, they do
not have brackets (or any other character) around them.
© Unisa
2024