Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
Section A, A2A (10 marks)
Multiple Choice (MC) and Matching Questions, Online (SOUL-Quiz Feature)
o Identify and select the option of choice that "best" completes the statement, matches the item, or
answers the question.
o Number of Attempts Allowed: 2
o Grading method: Highest Grade
o Make sure you have successfully completed, "Finished" and submitted before deadline.
* Attempts must be submitted before time expires, or they are NOT counted. (Zero mark given)
o Questions related to program codes are based on Python programming language, unless specified.
o 5 MC questions and 5 Matching questions. Each question carries the same mark.
Section B, A2B (20 marks): Programming Tasks
* IMPORTANT:
o Source code *.py file must start with comments, including the information of individual student
(student name, student id) as example below, unless specified. E.g. below
# A2B1.py, for IDSA A2
# FINISHED by: , <20214016>
class Rectangle: # define the class of Rectangle
o Modify the given Main testing file M*.py file (if any) to display the information of individual student
(student name, student id) as example below, unless specified. E.g. below
=== A2B1, Rectangle Program, by <20214016> ===
...
...
2 / 7
General requirements (unless further specified):
o Students should handle special cases, including empty structure, one-element structure, etc.
o Proper brief comments are required, at least at the top of each source code file.
o Proper indentations required in writing program codes.
o All related files (including *.py) should be working in the same folder.
o Python list is mainly used to hold data elements as an array in our course and this assessment.
DO NOT use methods of Python’s list (such as list.append() or list.insert() etc.),
inheritance in OOP, or other non-taught approaches in our course, unless specified.
Given Materials:
o This assignment document.
o Python file Stack.py. DO NOT modify the file.
o Python file A2B1.py, A2B2.py to be modified and completed by student.
Also modify top comments for your STUDENT INFO.
DO NOT modify the given portions, including given methods if any.
o Python files MA2B1.py and MA2B2.py, the main file(s) for basic running and testing.
DO NOT modify this given main test file, except the STUDENT INFO part.
A2B1 (10 marks)
Develop a Stack-based Queue having an internal Stack field, with the given Python file A2B1.py.
In our lecture notes, the sample Queue is implemented with Linked-List approach (with internal fields
head and tail nodes).
In this task, we need to re-implement the Queue ADT with another approach, a queue data type having an
internal field inStack of Stack type, only accessing the interface (operations) of the Stack.
o Treating data at TOP of Stack as FRONT of Queue; Bottom of Stack as REAR of Queue
* Useful hint: student may try to use two stacks to simulate a queue behaviour.
External: A Queue (behaviour) Internal: Use Stack to hold and access data