Simple Number Converter/Calculator
Create a program that converts and performs operations on Arabic Numbers and Roman Numerals
Your program should contain (but is not limited to) the following classes:
Number – abstract base class of all the number format classes
Integer – wrapper for the primitive integer
RomanNumeral – class for roman numeral
- All the number format classes must be instantiated with an (optional) initial value.
- For Integer instances, initial value is of type int and defaults to 0;
- RomanNumeral – initial value is empty string (“”)
- All these classes must have the following methods and must overload the following operators:
int toInteger() const;
std::string toRomanNumeral() const;
virtual bool parse() = 0; validation of values
Operators: +, -, *, /, %, >, <, >=, <=, ==, !=
- Notice the abstract method parse(). Take note that it should be called on the constructor of the class.
Integer* integ = new Integer(15);
integ->toInteger(); // returns 15
integ->toRomanNumeral(); // returns “XV”
- Allowed values are between [0, 1000]. Any operations and initializations with results beyond this range will be treated as invalid and must return -1 for toInteger() calls, and “INVALID” for toRomanNumeral()
- Arithmetic operations involving INVALID numbers should result to an INVALID object. Relational operations involving INVALID numbers should return false with some exceptions when there is equality involved.
- Also, you can create test cases for your program (but not part of the final checking).
10 pekerja bebas membida secara purata $33 untuk pekerjaan ini
Hi. I have review your project description. I have full experiences in Development. I am very interested in your project and also ready to start work immediately. Hoping for your soon Reply. Thank You Regard.
Hi sir ..have a good day. these are very simple requirements and can be implemented within a day.i am free so i can update you [login to view URL] you very much