#include<iostream>
#include"student.h"
#include"cctype"
#include"cstring"
using std::cin;
using std::cout;
using std::endl;
int main()
{
Stack<std::string> st;
char ch;
std::string po;
cout << "please enter a to add a purchase order,\n p ot process a po, or q to quit.\n";
while(cin>>ch&&std::toupper(ch)!='q')
{
while(cin.get()!='\n')
continue;
if(!std::isalpha(ch))
{
cout << '\a';
continue;
}
switch(ch)
{
case 'A':
case 'a':
cout << "enter a po number to add: ";
cin >> po;
if(st.isfull())
cout << "stack already full" << endl;
else
st.push(po);
break;
case 'p':
case 'P':
if(st.isempty())
cout << "stack already empty." << endl;
else{
st.pop(po);
cout << "PO # " << po << "popped\n";
break;
}
}
cout << "please enter a to add a puchase oredr,\n p to process a po, or q to quit." <<endl;
}
cout <<"bye" << endl;
return 0;
}