SIT221
Classes, Libraries and Algorithms
Work submitted late without documented approval of the Unit Chair or Lecturer will be
penalised. Assignments that are submitted after the submission date will be subject to a mark
penalty equal to 10% of the marks per day of the marks available for the piece of work, up to and
including three days after the published due date. Assignments submitted more than three days
after the published submission date will not be marked.
Unit Learning Outcomes
ULO1 – Design and construct solutions to programming problems by exploiting object-
oriented development in the C# programming language.
You will further develop your skills by developing your software solution/s using the
principles of object-oriented development and the C# programming language.
ULO3 – Explain the principles of major data structures and be able to construct solutions
to programming problems exploiting them.
You will further develop your understanding by implementing one or more data
structures for this assessment task.
ULO 5 – Interpret the information provided in library documentation and to produce
library documentation for your own solution.
You will further develop your understanding by writing library documentation for
this task.
SIT221 Classes, Libraries and Algorithms Due: 5pm Wednesday August 27th
Trimester 2, 2014: Programming Project 1 Page 2
Question 1 (30 marks)
Objective: In the first two weeks of the unit we reviewed how to solve problems using arrays and
introduced the concept of the linked list. These two data structures are fundamental to
understanding how to develop more advanced data structures and the algorithms that work
with them. To complete this task you will need to demonstrate your mastery /understanding of
arrays and/or linked lists.
Note 1: This task is a programming task worth 30 marks. If your submitted solution fails
to compile and/or run properly you have failed this task and will be penalized 50% of the
available marks for this question, i.e., you will lose 15 marks.
Note 2: Code that is commented out will not be marked.
Along with this task you have been provided with the code for a solution containing two
projects:
Project 1 – contains the Main method and Customer class for a system using the billing
system library; and
BillingSystem – a class library that contains the classes required to implement a simple
system for customer billing.
To complete this question, you only need to develop the TransactionList class in the
BillingSystem project (see below for requirements). No modifications to any other class is
required (or permitted).
The billing system class library implements a simplistic StockItem class including product
code, textual description, and price for the item. This is then used by the Purchase class which
records when a customer purchases multiple stock items (used for invoices). Three types of
transactions are supported:
Invoices – the purchase of several stock items which is billed to the customer’s account
(invoice total is added to customer’s account);
Payment – the record of a payment received against the customer’s account (payment
total is substracted from the customer’s account); and
Receipt – the record of a purchase by a customer who paid for the items at the same
time.
Two additional classes are used to implement the required structure in the object-oriented
model: IBillable, an interface which defines the required elements for anything to be added to
a TransactionList object, and BillableItem, which provides a base class for the transaction
types (to enable a TransactionList object containing all types of transaction).
SIT221 Classes, Libraries and Algorithms Due: 5pm Wednesday August 27th
Trimester 2, 2014: Programming Project 1 Page 2
If you have completed the TransactionList class correctly, you will receive the following
output:
Invoices:
=========
+----------+------------------------------+----------+----------+----------+
|Date |Description | Amount| Owed| Balance|
+----------+------------------------------+----------+----------+----------+
|10/07/2014|Invoice #14G10038746 | $5,748.60| $5,748.60| $7,168.10|
| 6/07/2014|Invoice #14G06009282 | $1,419.50| $1,419.50| $1,419.50|
|----------+------------------------------+----------+----------+----------|
Payments:
=========
+----------+------------------------------+----------+----------+----------+
|Date |Description | Amount| Owed| Balance|
+----------+------------------------------+----------+----------+----------+
|12/07/2014|Payment | $5,000.00|-$5,000.00|-$6,000.00|
| 6/07/2014|Payment | $1,000.00|-$1,000.00|-$1,000.00|
|----------+------------------------------+----------+----------+----------|
Receipts:
=========
+----------+------------------------------+----------+----------+----------+
|Date |Description | Amount| Owed| Balance|
+----------+------------------------------+----------+----------+----------+
|15/07/2014|Management of Information Secu| $124.95| $0.00| $0.00|
| 3/07/2014|Computer Networking: A Top-Dow| $135.75| $0.00| $0.00|
| 1/07/2014|Elementary Linear Algebra with| $158.95| $0.00| $0.00|
|----------+------------------------------+----------+----------+----------|
Statement:
==========
+----------+------------------------------+----------+----------+----------+
|Date |Description | Amount| Owed| Balance|
+----------+------------------------------+----------+----------+----------+
|15/07/2014|Management of Information Secu| $124.95| $0.00| $1,168.10|
|12/07/2014|Payment | $5,000.00|-$5,000.00| $1,168.10|
|10/07/2014|Invoice #14G10038746 | $5,748.60| $5,748.60| $6,168.10|
| 6/07/2014|Payment | $1,000.00|-$1,000.00| $419.50|
| 6/07/2014|Invoice #14G06009282 | $1,419.50| $1,419.50| $1,419.50|
| 3/07/2014|Computer Networking: A Top-Dow| $135.75| $0.00| $0.00|
| 1/07/2014|Elementary Linear Algebra with| $158.95| $0.00| $0.00|
|----------+------------------------------+----------+----------+----------|
TOTAL AMOUNT OWED: $1,168.10
SIT221 Classes, Libraries and Algorithms Due: 5pm Wednesday August 27th
Trimester 2, 2014: Programming Project 1 Page 3
The requirements for the TransactionList class are as follows:
Defined in the namespace BillingSystem
Uses generics, with the condition that the generic type implements IBillable
Implements a singly linked list where billable items are stored in reverse date order,
i.e., the first element in the linked list is the most recent transaction, the last element in
the linked list is the oldest transaction
Implements all members of the IList<TYPE> interface (and inherited interfaces,
including enumerator), with the following points:
o The Insert method is not supported and must throw the appropriate
exception
o The RemoveAt method must throw the appropriate exception if the index is
out of range
o For the indexer property, the set method is not supported, and the get
method must throw the appropriate exception if the index is out of range
o The CopyTo method must throw the appropriate exceptions for being passed a
null array or a multidimensional array, if the index is invalid, or if there is
insufficient capacity in the array to accept all data elements
Implements a read-only decimal property FinalBalance which returns the total
value of all stored transactions; only the foreach loop can be used inside this method
for traversing the linked list
Implements a method AsPrintable which returns a string containing a table
describing the data stored (as shown in the example output, above); only the foreach
loop can be used inside this method for traversing the linked list
Implements a method AsReadOnly() which returns a read-only collection of the
class (note that this has been provided for you in the skeleton code, but won’t work
until you complete the enumerator).
Skeleton code of this class has been provided to give you the general structure and some
additional hints. You may modify this class however you see fit (or ignore it entirely).
Remember that no other files may be modified however.
SIT221 Classes, Libraries and Algorithms Due: 5pm Wednesday August 27th
Trimester 2, 2014: Programming Project 1 Page 4
Question 2 (20 marks)
Objective: Understanding library documentation, both content and production, is an essential
skill for programmers. In this task you will be required to demonstrate your mastery /
understanding of library documentation. For this purpose, you will be required to use the
Doxygen automated documentation utility and associated XML tags.
Prepare appropriate documentation for your new collection satisfying the following
requirements:
You are required to document your collection using C# XML comments;
You are required to generate HTML documentation using the Doxygen tool;
Your documentation must include an example program (use the contents of the
Customer class for this purpose);
You must document the following elements for your class and each public variable,
property, and/or method of that class (you do not need to document any nested
classes):
o A general description of the class/variable/property/method
o All parameters;
o All return values; and
o Exceptions.
All text in the documentation must be in your own words, you may not reuse any text
from the MSDN documentation, workbook solutions, or any other source.
Your final submission must include both the commented code and the documentation as
generated by the Doxygen tool. Only the documentation generated by Doxygen will be
assessed for this question.
Hint: Make sure your example program appears correctly in the generated documentation!
SIT221 Classes, Libraries and Algorithms Due: 5pm Wednesday August 27th
Trimester 2, 2014: Programming Project 1 Page 5
SUBMISSION REQUIREMENTS
Please note the following submission requirements:
All classes must be stored in separate files, e.g., a class ExampleClass must be stored in
in a file ExampleClass.cs, unless otherwise indicated;
Only C# source files (*.cs) need to be submitted, you do not need to submit the whole
Visual Studio solution/project files;
Executable files (*.exe) should not be submitted, your program will be recompiled by
the marker;
All files relevant to your answer for each question should be submitted, i.e., you should
include a copy of any provided files and/or unmodified files;
You may combine the files for each task into a single ZIP file, however other
compressed file formats, e.g., RAR and 7z, will not be accepted (use separate folders if
you are submitting multiple questions in one ZIP file);
Further submission instructions are provided in CloudDeakin.
SIT221 Classes, Libraries and Algorithms Due: 5pm Wednesday August 27th
Trimester 2, 2014: Programming Project 1 Page 6
MARKING SCHEME
The following marking scheme will be applied to Question 1:
Class declaration:
o (1 mark) Defined in the BillingSystem namespace
o (1 mark) Implements the IList<> interface
o (1 mark) Uses generics that implement IBillable
Linked list:
o (2 marks) Correct linked list node structure used in the class
o (1 mark) Linked list is initialized correctly
o (2 marks) Add method maintains correct ordering
o (3 marks) Add and remove methods allow for all possible scenarios (empty list,
first element, etc.)
IList implementation:
o (5 marks) Exceptions thrown as indicated in requirements
Enumerator implementation:
o (2 marks) TransactionList class implements version tracking correctly
o (2 marks) Enumerator tracks version correctly
o (1 mark) Enumerator Current initially returns default value
o (2 marks) Enumerator MoveNext operation correct
Other requirements:
o (1 marks) FinalBalance calculates balance correctly according to requirements
o (3 marks) AsPrintable creates report string correctly according to requirements
(3 marks) Output is correct
Penalty for non-compilation / execution failure: -15 marks
The following marking scheme will be applied to Question 2:
(2 marks) XML comments used throughout TransactionList class appropriately
(3 marks) TransactionList class declaration adequately documented
(3 marks) Public methods adequately documented
(3 marks) Public properties adequately documented
(3 marks) Exceptions correctly documented
(3 marks) Example program included in documentation
(3 marks) HTML documentation generated by doxygen reasonable
Late penalties will be applied to the final mark, as per Faculty regulations:
Up to one day late: -5 marks
Up to two days late: -10 marks
Up to three days late: -15 marks
Note that late penalties are calculated based on the due date, not based on any indication of
lateness provided by CloudDeakin (which is often misleading).