Objectives: abstract data type (ADT), encapsulation
Integer types are very convenient, but their limited width makes them unsuitable for some applications where precise large values are more important than speed. Develop a class VeryLargeInteger that can handle arbitrary long integer numbers (both negative and positive) and the basic arithmetic operations (addition, subtraction, multiplication, division, and remainder).
Hint: The number could be represented as string, the sign could be represented either as boolean or as part of the string.
Note: Implementations of addition/subtraction through repeated use of a constant increment/decrement will not be accepted. Implementations of multiplication and division that rely on stepwise addition or subtraction will not be accepted.
1 | /** |
Turn in a zip file named blazerid hw1.zip. The file should contain an exported Eclipse project with the following items.
- All files needed to compile and run your solution.
- Your tests (test driver needs to be a separate file).
- A document (or text file) that describes your design decisions, your tests, any difficulties you had. If you would like to get a graded version on paper, add a note at the top of the report saying “paper copy requested”. If you received help from somebody else in class, please give credit to them.
Grading
- (10pts) Lab
- (10pts) request report.
- (10pts) Turned in code compiles without error or warning and code is well documented (consider using -Xlint:all and/or checkStyle).
- (10pts) Quality of test design.
- (10pts) Constructors, addition, subtraction, multiplication, and toString work correctly.
- (10pts) Division and remainder methods operations correctly.