Microsoft Word – Assignment1-2018.doc
University of Newcastle
Discipline of Computing and Information Technology
Semester 2, 2018 – SENG1120/6120
Assignment 1
Due using the Blackboard Assignment submission facility:
11:59PM – September 7th, 2018
NOTE: The important information about submission and code specifics at the end of this assignment
specification.
INTRODUCTION
You are required to build the infrastructure to manipulate data related to student scores. Your client
further specifies that you are to create a class named LinkedList to store the students’ information.
The LinkedList will store each name of the student and their score in a Node of the list, using the
provided class Student.
ASSIGNMENT TASK
You are required to use a linked list, as discussed in lectures, to create your own implementation of the
LinkedList class. It will use instances of Node to store instances of value_type (in this
assignment, each Node will be used to store an instance of Student).
The LinkedList class will be used by a main program, to be supplied to you, as well as a
makefile. You will need to design LinkedList and Node in a way that it communicates
seamlessly with the main program and the class Student provided, and compiles with the
makefile also supplied. Please refer to the lecture slides and recordings for guidance on how to
implement both classes.
For students who want to practice more, we have bonus marks:
(1.0 mark) Implement the member method void order() inside LinkedList. That
method will order the names of the student in alphabetical order. You are NOT ALLOWED to
manipulate the contents of the Node’s value_type variable. You can only manipulate the
pointers of the nodes to move them around until the list is ordered. In addition, you are NOT
ALLOWED to instantiate new nodes in the implementation of the method void order().
SUBMISSION
Make sure your code works with the files supplied, and DO NOT change them. For marking, we will
add the main file and the Student class to the project and compile everything using the makefile,
together with your own files. If it does not compile or run, your mark will be zero.
Your submission should be made using the Assignments section of the course Blackboard site.
Incorrectly submitted assignments will not be marked. You should provide the .h and .cpp files
related to the linked list and node classes, only, plus an assessment item coversheet. Also, if necessary,
provide a readme.txt file containing instructions for the marker. Each program file should have a
proper header section including your name, course and student number, and your code should be
properly documented.
Remember that your code should compile and run correctly using Cygwin. There should be no
segmentation faults or memory leaks during or after the execution of the program.
Compress all your files into a single .zip file and submit it in by clicking in a link that will be created in
the Assignments section on Blackboard.
Late submissions are subject to the rules specified in the Course Outline. Finally, a completed
Assignment Cover Sheet should accompany your submission.
This assignment is worth 15 marks of your final result for the course.
Compiling and running your files together with the demo file provided should output the following
result:
Alexandre@ces249-339952s /cygdrive/c/Alexandre/Courses in preparation/2018 – SENG1120
S1/Assignments2018/Assignment 1/Sol
$ ./assignment1.exe
Start lists:
List 1: (Alex,15) (Peter,10) (John,32) (Mary,50) (Carol,31)
List 2: (Michelle,12) (Carol,27) (Tim,20) (Michelle,90) (John,75) (Tony,60)
Concatenating the two lists onto list ‘1’:
List 1: (Alex,15) (Peter,10) (John,32) (Mary,50) (Carol,31) (Michelle,12) (Carol,27)
(Tim,20) (Michelle,90) (John,75) (Tony,60)
List 2: (Michelle,12) (Carol,27) (Tim,20) (Michelle,90) (John,75) (Tony,60)
Removing student ‘Alex’ from list ‘1’:
List 1: (Peter,10) (John,32) (Mary,50) (Carol,31) (Michelle,12) (Carol,27) (Tim,20)
(Michelle,90) (John,75) (Tony,60)
List 2: (Michelle,12) (Carol,27) (Tim,20) (Michelle,90) (John,75) (Tony,60)
Removing student ‘John’ from list ‘2’:
List 1: (Peter,10) (John,32) (Mary,50) (Carol,31) (Michelle,12) (Carol,27) (Tim,20)
(Michelle,90) (John,75) (Tony,60)
List 2: (Michelle,12) (Carol,27) (Tim,20) (Michelle,90) (Tony,60)
Removing student ‘Michelle’ from both lists:
List 1: (Peter,10) (John,32) (Mary,50) (Carol,31) (Carol,27) (Tim,20) (John,75)
(Tony,60)
List 2: (Carol,27) (Tim,20) (Tony,60)
Removing student ‘Fred’ from list ‘2’:
List 1: (Peter,10) (John,32) (Mary,50) (Carol,31) (Carol,27) (Tim,20) (John,75)
(Tony,60)
List 2: (Carol,27) (Tim,20) (Tony,60)
Average of list ‘1’: 38.125
Average of list ‘2’: 35.6667
Number of students named ‘Carol’: 3
The program has finished.
Alexandre@ces249-339952s /cygdrive/c/Alexandre/Courses in preparation/2018 – SENG1120
S1/Assignments2018/Assignment 1/Sol