-
Switch statements
OK. I need to write a program that converts numeric dates to the actual words. For example, 1/1/01 would print "January First Two Thousand and One". I have do this using a switch statement. I am clueless as to where to start or what to do. Any help would be great.
-
input the string numbers. parse the string of numbers using strtok() or strstream() or your own parsing function or have user input separate numbers for each variable. Then do something like this for each variable you need to convert from symbol to word:
char ch = '*';
switch (ch)
{
case '+':
cout << "plus sign' << endl;
break;
case '&':
cout << "ampersand" << endl;
break;
case '7':
cout << "lucky number seven" << endl;
break;
//etc.