CSE2305 - Object-Oriented Software Engineering
assessment

 

Assignment 1


This assignment is due before 11.59pm Friday, August 12, 2005 ( ).
Total marks: 50.
Contribution to final mark: 5%.

Synopsis


Note:

In order to compile and run C++ programs you should use g++, not gcc.


Question 1

[10 marks]

Examine the C++ source code in the files List.h, List.cpp and main.cpp (download them from here – a gziped tarball).

  1. Create a Makefile that has targets to build an executable and to remove any intermediate files.

  2. Explain what the code does and how it works. In particular, explain the purpose of the List::Node class¤.

  3. Using gdb, trace the execution of the code and verify your explanation (you don't have to submit this).

  4. To reinforce and preserve your new understanding, comment the code.


Question 2

[10 marks]
  1. As provided, the List class¤ has no destructor¤. Explain why a destructor¤ is needed.

  2. Write a suitable destructor¤ for class¤ List.


Question 3

[10 marks]

The List class¤ can add elements (via List::Insert(string)) but can't remove them. Write a List::DeleteCurrent(void) member¤ function which removes the current element in the list.


Question 4

[10 marks]

Using a suitable sorting algorithm, write a List::Sort(void) member¤ function, which sorts the list. Test your class by writing a program to sort this sample list of words. You should sort the words in lexicographic (i.e. dictionary) order.


Question 5

[10 marks]

Use the UML graphic notation to describe your final version of the List class.


What to submit for assessment

You should submit the following:

See the submit page for details on how to submit your assignment. Please make sure all files you submit contain this student declaration which attests that your submission is your own work.


This material is part of the CSE2305 - Object-Oriented Software Engineering course.
Copyright © Jon McCormack, 2005. All rights reserved.

Last Modified: August 8, 2005