[SOLVED] Implement a class to represent a Roman Number

30.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon Implement-a-class-to-represent-a-Roman-Number-y00r0s.zip (2.8 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
🔒 Securely Powered by:
Secure Checkout
5/5 - (2 votes)

Implement a custom type for representing strings in C++. Allow following operations as well as operators, considering dynamic memory allocation:

Operations:

  • length: determine the length of string
  • upper: convert the string to upper case
  • lower: convert the string to lower case
  • at: return character at a given index
  • substring: extract a substring given start and end
  • index: find starting index of a substring
  • compare: compare two strings
  • concat: concatenate/append the argument after current string. Cater cases for different data types such as String, C-string, char, int, float
  • prepend: concatenate/append the argument before current string. Cater cases for different data types such as String, char, int, float

Operators:

  • + : for concatenation and prepend operations taking into account different data types and order of argumets
  • = : for assignment
  • ==, !=, < and > : for comparison operations
  • [] : for access to character at a given index
  • >> and <<   : for output and input a string

Roman Number

Implement a class to represent a Roman Number based upon the Standard Form described on the Wikipedia page (https://en.wikipedia.org/wiki/Roman_numerals). Support following operations using corresponding operators:

  • + : for adding two roman numbers
  • – : for subtracting two roman numbers
  • * : for multiplication of two roman numbers
  • / : for division of two roman numbers
  • ==, !=, < and > : for relational comparison of two roman numbers
  • ++ and – – : for increment and decrement, both prefix and postfix versions
  • Implement-a-class-to-represent-a-Roman-Number-y00r0s.zip