Advertisement
darkhelmet125

RomanType - header file

Oct 4th, 2011
144
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.80 KB | None | 0 0
  1. /*Matt Short
  2. CPSC 131
  3. Purpose: Create a header file holding the 6 functions
  4. needed for the menudriver
  5. */
  6. //SPECIFICATION FILE (ROMANTYPE_H)
  7. class RomanType     //declares a class data type
  8. {
  9. public:             //6 Public Functions
  10.         void getArabicNumber();
  11.         /*  Function: Gets Arabic Numbers
  12.             Precondition: none
  13.             Postcondition: user is prompted for an arabic number,
  14.             which is then retrieved
  15.         */
  16.         void getRomanNumber();
  17.         /*  Function: Gets Roman Numeral
  18.             Precondition: none
  19.             Postcondition: user is prompted for a roman numeral,
  20.             which is then retrieved
  21.         */
  22.         void printRoman();
  23.         /*  Function: Prints Roman Numeral
  24.             Precondition: arabic number is converted to a roman numeral
  25.             Postcondition: converted number is printed
  26.         */
  27.         void printArabic();
  28.         /*  Function: Prints Arabic Number
  29.             Precondition: roman numeral is converted to an arabic number
  30.             Postcondition: converted number is printed
  31.         */
  32.         void convertToRoman();
  33.         /*  Function: Convert an Arabic number to a Roman numeral
  34.             Precondition: user has entered a correct arabic number
  35.             Postcondition: arabic number is successfully converted to
  36.             a roman numeral
  37.         */
  38.         void convertToArabic();
  39.         /*  Function: Converts a Roman Numeral to an Arabic number
  40.             Precondition: user has entered a correct roman numeral
  41.             Postcondition: roman numeral is successfully converted to
  42.             an arabic number
  43.         */
  44.         RomanType();
  45.         /*  Function: constructor
  46.             Pre:No instance of class RomanType exists
  47.             Post:An instance of class RomanType is created
  48.         */
  49.         ~RomanType();
  50.         /*  Function: destructor
  51.             Pre:At least one instance of class RomanType exists
  52.             Post:No instances of class RomanType exists
  53.         */
  54. private:        //2 private variables
  55.         int arabicInput;    //variable to hold arabic input
  56.         char romanInput[50];    //variable to hold roman input
  57. };
  58.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement