1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80
|
#include <iostream>
#include <sstream>
#include <String>
#include <iomanip>
using namespace std;
const int hours = 3;
const int staff = 10;
string artists[staff] ={"Amy","David","John","Helen","Mumu","William","Sunny","Rocky","Benny","Dawn"};
int staffHours[staff][hours];
//Functions
int enterPay(int[][hours],int);
int main()
{
int choice; //Menu choice
//Constants for menu
const int MENU_ONE =1,
MENU_TWO =2,
MENU_THREE =3,
MENU_FOUR =4,
MENU_FIVE =5;
do
{
showMenu();
cin >> choice;
//Validate choice selected for menu
while (choice < MENU_ONE||choice >MENU_FIVE)
{
cout << "Please enter a valid choice: ";
cin >> choice;
}
if (choice != MENU_FIVE)
{
switch (choice)
{
case MENU_ONE:
enterPay(staffHours,staff);
break;
case MENU_TWO:
break;
case MENU_THREE:
break;
case MENU_FOUR:
break;
}
}
} while (choice != MENU_FIVE);
checkout();
return 0;
}
int enterPay(int[][hours],int staff)
{
for (int x=0; x < staff; x++)
{
for (int y=0; y < hours; y++)
{
cout << "Enter " << x+1 << "'s hours #" << y+1 << " :";
staffHours[x][y]= getInt();
}
}
|