I'm supposed to create a program that displays a check. We're working with Characters and Strings. My question is, How can I take a number someone has inputted and make it read out in words (ex. Input = 99.99, Output = Ninety Nine Dollars and Ninety Nine cents)? My teachers suggests using arrays to hold data, but I don't see how that's necessary if we're only supposed to display one check.
You might want to use std::getline() to read the date and the name, because the date has non-alpha chars or spaces and the name may have spaces:
1 2 3 4 5 6
cout << "What is today's date?" << endl;
std::getline(cin, date);
cout << "What is the payee's name?" << endl;
std::getline(cin, name);
cout << "What is the amount of the check?" << endl;
cin >> amount;
EDIT: As you are reading the amount in as a string you may want to use std::getline() with that also.