Professional Documents
Culture Documents
Driver
Driver
using std::cout;
using std::cin;
using std::endl;
#include<cstdlib>
//#include "Miscellaneous.h"
void showMenu();
int getResponse();
int main()
{
int response;
//NOTE: each time you finish writing a function and want to test it,
//uncomment the case within the switch that calls that function.
while ( ( response = getResponse() ) != 5 )
{
switch( response )
{
return 0;
void showMenu()
{
system("cls");
cout<<"***********************************\n";
cout<<"* Press 1 to do multiplication *\n";
cout<<"* Press 2 to play number guessing *\n";
cout<<"* Press 3 to print a square *\n";
cout<<"* Press 4 to calculate payroll *\n";
cout<<"* Press 5 to Quit *\n";
cout<<"***********************************\n";
cout<<"=====> ";
int getResponse()
{
int response;
showMenu();
cin>> response;