COMP2511 21T3 Practice Exam
There are three parts,
Part 1: Short Answer (30 marks).
Part 2: Programming Questions (70 marks).
Copyright By https://powcoder.com 加微信 powcoder
Change Log Exam Conditions
You can start reading the exam at 14:00 (2pm) Wednesday 1st December 2021 Sydney time (AEST).
You can start typing at 14:00 (2pm) Wednesday 1st December 2021 Sydney time (AEST).
You have until 17:00 (5pm) Wednesday 1st December 2021 Sydney time (AEST) to complete this exam.
Only submissions before 17:00 (5pm) Wednesday 1st December 2021 Sydney time (AEST) will be marked.
Except, students with extra exam time approved by Equitable Learning Services (ELS) can make submissions after 17:00 (5pm) Wednesday 1st December 2021 Sydney time (AEST) within their approved extra time. You are not permitted to communicate (email, phone, message, talk, social networks, etc.) with anyone during this exam, except COMP2511 staff.
Again, please note that you are not permitted to get help from anyone except COMP2511 staff during this exam.
You are not permitted to access web pages or other internet resources, except the following web pages (for the exam, the lecture notes and documentation):
1. you can access and read this exam paper!
2. you can access the course material available on the course webpage and your course work (your tut/lab solutions, assignment and project work). 3. you can also access Java API available online at https://docs.oracle.com/en/java/javase/11/docs/api/index.html .
You are not permitted to access any other papers, books or computer files, except for the following: this exam, your tut/lab solutions, assignment and project work for this course.
You are not permitted to use code-synthesis tools such as GitHub Copilot and other similar tools.
Importantly, please make sure that you submit your original work and don’t copy! We will use sophisticated plagiarism software/techniques to detect any possible breaches.
Even after you finish the exam, on the day of the exam, on the day of the exam do not communicate your exam answers to anyone. Some students have extended time to complete the exam. Do not place your exam work in any location, including file sharing services such as Dropbox or GitHub, accessible to any other person.
Ensure during the exam no other person in your household can access your work.
Your zpass should not be disclosed to any other person. If you have disclosed your zpass, you should change it immediately.
Deliberate violation of exam conditions will be referred to Student Integrity as serious misconduct.
Answer all questions. Questions may not be worth equal marks. Questions may be answered in any order. All answers must be submitted online using the provided instructions in the respective questions.
Important Information for Online Assessments
Before your final exam, you must read the section “Important Information for Online Assessments” available on the Special Consideration webpage. It offers information on what you should do if you experience a technical issue that is beyond your control and impacts on your ability to complete an assessment, and the other related topics. In particular, how and what to document for a special consideration application.
Please also read the check list provided by UNSW Student Services & Systems, click here . During the Exam
If you have a question or need a clarification during the exam, you can make a PRIVATE post on the Ed forum. Do not send a message to the lecturer (or tutors), you may not get a response. When posting a message to the forum, it’s important that you provide all the required details. Failure to do this may result in delays in responding to your queries.
To ensure that you are as prepared for your online exam as you can be, make sure you check each point listed in the “Online Exam Preparation Checklist”. In particular, read the following sections:
Fit to Sit
Technical Issues
Communication during the exam
Sharing answers with others or posting them online
Setting up the exam
Follow the given steps below to install the exam, they are done this way to prevent load on gitlab.
Download the git bundle
Run the following commands to unpack it, make sure that you replace the zID with your one.
You can check your responses by going to your unique repository (again replace the zID)
https://gitlab.cse.unsw.edu.au/COMP2511/21T3/students/z555555/exam-sample
Short Answer (30 marks)
Please place all your answers to the short answer questions in your answers.md file.
Question 1 (5 marks)
You are implementing a health application that monitors heart rate of a patient. If the heart rate of a patient is out of the required range, the application needs to inform all the relevant doctors and nurses. Doctors and nurses responsible for a patient may change over time. Give the most appropriate design pattern for the following situations, briefly justifying your answer.
Question 2 (5 marks)
A user bought an application that reads data in JSON format, and displays results on a web page. Later, the user realised that one of their data sources is in XML format. Unfortunately, the user does not have access to the source code of the application, so it is not possible to change the application. Give the most appropriate design pattern for the following situations, briefly justifying your answer.
Question 3 (3 marks)
Briefly explain the important differences between the Decorator Pattern and the Builder Pattern, as discussed in the lectures.
Question 4 (3 marks)
Which of the following statements is true? (There may be more than one). Justify your answer.
a. Template Method lets subclasses redefine an algorithm, keeping certain steps invariants.
b. Subclasses of the Template Method can redefine only certain parts of a behaviour without changing the algorithm’s structure. c. A subclass calls the operations of a parent class and not the other way around.
d. Template pattern works on the object level, letting you switch behaviours at runtime
Question 5 (3 marks)
a. Identify one code smell in this program. (1 mark)
b. Identify and explain the most pertinent (problematic) design smell in this program. (2 marks)
Question 6 (2 marks)
In the project, what was the purpose of Milestone 1? What design and development methodologies does it combine?
Question 7 (2 marks)
Which of the following is correct? There may be more than one correct answer.
a. List is a subtype of List