I could use some help getting my code to work.
The user inputs the time in digits (ex: 7 35) and
then the time is output in text (ex: seven thirty-five).
I have populated an array but i can't get anything to
print from the array. Here is what I have come up with
so far.....
#include <iostream>
#include <string>
using namespace std;
string harray[23];
string marray[58];
int hournum;
int minnum;
void setuparray();
string h;
string m;
int main()
{
while (hournum != 9 && minnum != 99)
{
cout << "Enter time: ";
cin >> hournum >> minnum;
h = harray[hournum + 1];
m = marray[minnum + 1];
cout << h << m;
}
system("pause");
return 0;
}
void setuparray()
{
harray[0] = "one";
harray[1] = "two";
harray[2] = "three";
harray[3] = "four";
harray[4] = "five";
//i left out some of it because it is long
marray[0] = "one";
marray[1] = "two";
marray[2] = "three";
marray[3] = "four";
marray[4] = "five";
marray[5] = "six";
marray[6] = "seven";
}