Help please with function program.
I am rather new to C++ and I have to write a program that will accept data for today's date, first name, last name, and amount to an enterData() function and pass it to a printCheck() function. Then I need it to display in the correct spots on a check. I am stuck and am not really sure what to do next. Please help.
[code]
Code:
#include "stdafx.h"
#include <iostream>
#include <string>
using namespace std;
// Function prototypes:
void enterData();
void printCheck();
int _tmain(int argc, _TCHAR* argv[])
{
enterData(); // call to function
printCheck(); // call to function
return 0;
}
void enterData() // function
{
string todaysDate, firstName, lastName;
double amount;
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;
}