You need a method to preserve the data entered in the enterData function so that it can later be displayed in the printCheck function. You can do this best by declaring the variables in the main function and passing them (by reference) into the enterData function. Any changes made to them in that function will be reflected in the values the variables have in the main function. Then you can again pass them to the printCheck function so they can be output.
Code:
void enterData(string&,string&,string&,double&);
void printCheck();
int _tmain(int argc, _TCHAR* argv[])
{
string todaysDate, firstName, lastName;
double amount;
enterData(todaysDate,firstName,lastName,amount); // call to function
printCheck(); // call to function
return 0;
}
void enterData(string& todaysDate, string& firstName, string& lastName, double& amount) // function
{
cout << "Enter today's date: ";
cin >> todaysDate;
cout << "Enter the first name: ";
cin >> firstName;
cout << "Enter the last name: ";
cin >> lastName;
cout << "Enter the amount: ";
cin >> amount;
}
void printCheck() //function
{
cout << "Zzyz Corp Date: (today's date)"<<endl;
cout << "1164 Sunrise Avenue "<<endl;
cout << "Kalispell, Montana\n "<<endl;
cout << "Pay to the order of: (firstName lastName) $ (amount)\n "<<endl;
cout << "UnderSecurity Bank "<<endl;
cout << "Missoula, MT "<<endl;
cout << " ____________________"<<endl;
cout << " Authorized Signature";
cout << endl << endl;
}
Now you just need to modify the bits in red above, the printCheck function related code, to accept those arguments and print them out. I'll leave that as an exercise for you.