Datasheet

Employee& emp3 = myDB.addEmployee(“Nick”, “Solter”);
emp3.setSalary(10000);
emp3.promote();
cout << “all employees: “ << endl;
cout << endl;
myDB.displayAll();
cout << endl;
cout << “current employees: “ << endl;
cout << endl;
myDB.displayCurrent();
cout << endl;
cout << “former employees: “ << endl;
cout << endl;
myDB.displayFormer();
}
The User Interface
The final part of the program is a menu-based user interface that makes it easy for users to work with
the employee database.
UserInterface.cpp
// UserInterface.cpp
#include <i0stream>
#include <stdexcept>
#include “Database.h”
using namespace std;
using namespace Records;
int displayMenu();
void doHire(Database& inDB);
void doFire(Database& inDB);
void doPromote(Database& inDB);
void doDemote(Database& inDB);
int main(int argc, char** argv)
{
Database employeeDB;
bool done = false;
while (!done) {
int selection = displayMenu();
switch (selection) {
38
Chapter 1
04_574841 ch01.qxd 12/15/04 3:39 PM Page 38