(To be handed to Ms Williams in room 3.05A - remember to sign the "submission list" - by 9:30 on Monday 13 November 2000)
[Part 1] Using some appropriate formalism design/specify a program that takes as input two sets of integers, X and Y, and outputs (to the screen):
Thus given X = {4, 3, 1, 5, 0, 2}, and Y = {4, 7, 9, 5, 6, 8, 3}; then
The cardinality of the sets (i.e. the number of elements in the sets) can be any number N such that N is greater or equal to 0 and N is less than or equal to 10.
NOTE: By definition; (1) a set has no duplicates, and (2) the elements are not necessarily ordered in any way.
[Part 2] Implement your design using the C imperative programming language.
[Part 3] Test your implementation using appropriately defined test cases.
Your answer should comprise:
A specification, appropriately presented, to address part 1. |
A Listing of program code for part 2. |
A list of test cases and results with respect to part 3. |
Created and maintained by Frans Coenen. Last updated 03 July 2001