1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
#ifndef NUMBER_H
#define NUMBER_H
#include<iostream>
#include <string>
using namespace std;
class Number
{
private:
int number;
static string lessThan20[20];
static string restTens[7];
static string hundreds;
static string thousands;
public:
Number(int);
void print();
string translator(int);
};
string Number::lessThan20[20] = { "zero","one","two","three","four","five","six","seven","eight","nine","ten","eleven","twelve","thirteen","fourteen","fifteen","sixteen","seventeen","eighteen","nineteen"};
string Number::restTens[7] = {"thirty","fourty","fifty","sixty","seventy","eighty","ninety"};
string Number::hundreds ="hundreds";
string Number::thousands="thousands";
#endif
|