// Justin C. Miller
// University of Wisconsin Oshkosh
// Made for: http://www.geocities.com/neonprimetime.geo/index.html
// Date: 2001
// Borland Builder 4.0
#include
#include
#include "data.h"
#include "stack.cpp"
void DoItAgain(int&) ;
void InsertPlayers(stack&) ;
void PrintReverse(stack&) ;
int main()
{
int again = 1 ;
stack yankees(9) ;
do{
InsertPlayers(yankees) ;
DoItAgain(again) ;
}while(again == 1) ;
PrintReverse(yankees) ;
return 0 ;
}
void DoItAgain(int& a)
{
cout << "What would you like to do next?" << endl ;
cout << "0-(Quit + Print in Reverse Order)" << endl ;
cout << "1-(Insert Another Player, max is 9" << endl ;
cin >> a ;
}
void InsertPlayers(stack & x)
{
int yes = 0;
char * ln , * fn ;
ln = new char[50] ;
fn = new char[50] ;
int j;
do{
cout << "Please enter a player's last name:" ;
cin >> ln ;
cout << "Please enter their first name:" ;
cin >> fn ;
cout << "Please enter their jersey number:" ;
cin >> j ;
cout << endl << "Name: " << fn << " " << ln << " #" << j << endl ;
cout << endl << "Is this info correct?" << endl ;
cout << "1-yes , 0-no" << endl ;
cin >> yes ;
}while(yes != 1) ;
player NewGuy ;
NewGuy.setINFO(ln, fn, j) ;
x.push(NewGuy) ;
delete ln, fn ;
}
void PrintReverse(stack & x)
{
while(!x.IsEmpty())
cout << x.pop() << endl ;
}
               (
geocities.com/neonprimetime.geo/cpp)                   (
geocities.com/neonprimetime.geo)