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
|
while(!exitLoop)
{
choice = mainMenu(); //returns the verified input from main menu
choice = menuValidation(choice);
if (choice == 'D' || choice == 'd') //if choice is 'D' exit the loop
exitLoop = true;
cout << endl;
choice = static_cast<int>(choice); //change status of choice from char to int
if(choice == '1')
{
displayOccupiedOffices(total, buildingArray);
total =calculateCurrentStat(buildingArray, numLawyer, numParalegal, numAssistant);
// cout << "choice 1= " << choice;
}
else if(choice == '2')
{
displayOccupiedOffices(total, buildingArray);
total =calculateCurrentStat(buildingArray, numLawyer, numParalegal, numAssistant);
//cout << "choice 2= " << choice;
}
else
{
displayEmptyOffices(buildingArray); //displays all empty offices
enumType = optionThree(flrNum, officeLetter); //displays option 3 questions (floor number, column letter, and occupant type)
officeNum = convertLetterToNumber(officeLetter); //converts the office letter to a numeric value
buildingArray[flrNum][officeNum] = enumType; //adds the occupant type to the 2D array (enumerated type)
//occupantName = displayOccupantType(enumType); //occupantName becomes the string value of the enumerated type name
newOccupancyMessage(occupantName, flrNum, officeLetter, buildingArray); //displays new occupant message
total =calculateCurrentStat(buildingArray, numLawyer, numParalegal, numAssistant); //re-calculates all current status in the array
//cout << "choice 3= " << choice;
}
}
|