HRSystem_5/src/Organization/HRSystem.java
// display the main menu and perform transactions
display the main menu and perform transactions
display the main menu and perform transactions
private void performTransactions() 
   {
      Transaction currentTransaction = null;
      boolean userExited = false; 
      while ( !userExited )
      {     
         int mainMenuSelection = displayMainMenu();
         switch ( mainMenuSelection )
         {
            case EMPLOYEE_INQUIRY: 
            case COMPANY_DETAILS: 
            case HIRE:
            case FIRE:
            case VIEWPAYROLL:  
               currentTransaction = createTransaction( mainMenuSelection );
               currentTransaction.execute(); 
               break; 
            case EXIT: 
               screen.displayMessageLine( "\nExiting the system..." );
               userExited = true; 
               break;
            default: 
               screen.displayMessageLine( 
                  "\nYou did not enter a valid selection. Try again." );
               break;
         } 
      } 
   }
private void performTransactions ( ) { Transaction currentTransaction = null ; boolean userExited = false ; while ( ! userExited ) { int mainMenuSelection = displayMainMenu ( ) ; switch ( mainMenuSelection ) { case EMPLOYEE_INQUIRY : case COMPANY_DETAILS : case HIRE : case FIRE : case VIEWPAYROLL : currentTransaction = createTransaction ( mainMenuSelection ) ; currentTransaction . execute ( ) ; break ; case EXIT : screen . displayMessageLine ( "\nExiting the system..." ) ; userExited = true ; break ; default : screen . displayMessageLine ( "\nYou did not enter a valid selection. Try again." ) ; break ; } } }
display the main menu and perform transactions
display the main menu and perform transactions
// local variable to store transaction currently being processed // user has not chosen to exit // loop while user has not chosen option to exit system // show main menu and get user selection // decide how to proceed based on user's menu selection // user chose to perform one of three transaction types // initialize as new object of chosen type // execute transaction // user chose to terminate session // this HRSystem session should end // user did not enter an integer from 1-4 // end switch // end while