Machine Problem 4 due May 2

Part of the homework for 22C:60, Spring 2005
by Douglas W. Jones
THE UNIVERSITY OF IOWA Department of Computer Science

Machine problem 4, Due May 2

The following files contain components of MP4:

number.h
The header file for the abstract class number.

numbin.h
The header file for the concrete class numbin, which implements the abstract class number using 32-bit binary numbers

numbin.a
The source code for the implementation of concrete class numbin.

main.a
The source code for a main program to test much of numbin. This illustrates creation of objects of type numbin and calls to methods of those objects to initialize them and opereate on them.

Your assignment is to write the header file for the class numbcd and the implementation of this class, so that your implementation is also a subclass of the class number. Your class must be defined so that objects class numbin and numbcd can be freely intermixed, so, for example, you can add a binary number to a bcd number or add a bcd number to a binary number.

You will be able to steal quite a bit from the material provided.

Your solution should be packaged as a directory called mp4; this directory should containin 2 files, numbcd.a, numbcd.h. The directory may contain other files, but only these two will be examined in grading.

The grader will write a main program that tests your program by assembling numbcd.a, linking it with a main program for testing, and with an implementation of some other implementation of the abstract class number, in order to test how well your implementation interoperates with other kinds of numbers.

You are completely responsible for testing your code. You can borrow bits of the test program provided, but you should also test your code with arguments from other implementations of the abstract class number, for example, with binary integers.

The TA's grading program will not exercise overflow conditions, so for this version of the assignment, you are not responsible for how these conditions are handled.

Notice: The second midterm will have a problem based on this assignment.