In order to receive credit for this assignment, it must be submitted, using the handin command, by 9 AM on Monday, March 7th.
The purpose of this assignment is to provide an opportunity for you to become familiar with C++ classes, nested classes, iterators, overloaded operators, pointer variables and memory management, and efficiency considerations. In order to receive full credit, your program must compute 1#1 in less than 2 seconds.
Your program should include a C++ class that encapsulates the concept of a large unsigned number; I'll refer to this class as BigInt, but you can call it anything you like, such as ExtendedInt, LargeInt, ExtendedInteger, etc.
For this assignment you may not use any container functionality in the standard C++ library - you must write your own list class, together with forward and reverse iterators that operate on your list class.
This assignment will help you understand pointer variables and how memory is managed; in particular, you will not be able to compute 1#1 in two seconds if you have a memory leak. Also, you will see how iterators work in the standard C++ library. Finally, an important aspect of this assignment is for you to get some practice in assigning responsibilities to classes, in OO fashion. Thus, your list class should only be responsible for list functionality, not addition, or other arithmetic operations. Arithmetic operations should be assigned to your BigInt class as overloaded operators. Most importantly, all of your classes should be in canonical form.
To help you get started, we will write some of the list functions that you will need, and we will also write some of the iterator class. Also, I will provide an example of a GUI program that uses SDL to retrieve textual input from the user and, as the user is typing, will print the leet translation. You can also use both my solution and any other student's solution to the first assignment as a basis for solving this second assignment. These solutions can be found on my web page and the GUI input example can be found at:
http://www.cs.clemson.edu/~malloy/courses/481-2005/assign/2/newleet/
To get full credit, you will need to write code to accomplish the following:
You are not required, nor is it expected, that you implement all of the functionality in the STL list.
Your GUI must be implemented with SDL. Your program and your GUI should handle arithmetic expressions of the form:
<operand> <operator> <operand>Where 2#2operand3#3 is a positive integer of arbitrary precision, and 2#2operator3#3 is either 4#4, 5#5, or 6#6. Thus, legal expressions include:
2 * 999999999999999999999999999999999999 33333333333333333333333333333333333 * 444444444444444444444 2 ^ 1000
Your GUI can be modeled after the extended leet example
that I will demo in class and have placed on the web page;
or, you can write your own GUI. However, your GUI should look good,
be easy to use and provide hints to help the user demo your program.
I will caution you that some of the pitfalls of using SDL for
our GUI is that it may be somewhat difficult to retrieve an
operator, such as 4#4, since there are two keystrokes involved.
Figure
illustrates output from the
instructors solution.
![]() |
In your submitted program, include all files that we need to run your program, including the ttf file. Please do a make clean before you submit. Also, include a README file for your submitted solution that describes you, the course and the assignment. Please list the strengths and weaknesses of your solution, what it does and does not do.
Finally, use the handin command to submit you final program. The handin command works as follows:
handin.481.2 <asgn #> <files> for example: handin.481.2 2 *