Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
COMP281 Assignment 2
• In the following, you will find the problems that constitute Assignment 2. They will be also available via Code
Grade on the canvas module for COMP281.
• You need to write a C program (not C++ or C#) that solves each problem – it must read the input, as specified
in the problem description then print the solution to the given problem for that input.
o Note that code is “correct” only if it correctly implements a solution to the problem stated in the
assignment, not "if Code Grade accepts it".
o That is, even if Code Grade accepts your code, it could be wrong. Read the problems carefully.
• Input is read from the standard input, in the same way that you read input from the keyboard as shown in lectures
(e.g., using scanf). Output is also printed to the standard output, as you have seen (e.g., using printf).
• You must also include a brief report describing your solutions to the problems. This should be the equivalent of
maximum two sides of A4 paper and should give a description of how each of your solutions works. This should
include describing the algorithm used to reach the solution, describing your use of any C language features (that
were not discussed in lectures) and identifying any resources that you have used to help you solve the problems.
A separate canvas assignment called “Assignment 2 brief report” has been setup for this.
• This assignment is worth 50% of the total mark for COMP281.
o Both problems are weighted equally.
o For each problem, your solution can earn a total of 50 points (scaled from 20 points per solution in
assignment 1).
§ 25 points for “Functionality and Correctness” awarded for programs that correctly solve the
problem for all test cases.
§ 20 points for “Programming style, use of comments, indentation and identifiers” awarded
depending on the style, comments and efficiency of the solution
§ 5 points for the quality and depth of the accompanying report
o The final grade results from normalising the earned points to a scale of 100.
o See separate “comp281-detailed-marking-guidelines.pdf” for more details (note that in that document,
the mark deductions referred to will be scaled by 2.5 for assignment two, since the document refers to
assignment 1, where there were 5 parts vs the 2 parts to this assignment. e.g. if an issue for a program
in assignment one had a penalty of up to four marks, the same issue found in a program for
assignment two will have up to a ten mark penalty).