For the Queue use ArrayDeque, but only allowed to use the methods that are queue related.

For the Stack also use the ArrayDeque, but only allowed to use the methods that are stack related.

See java documentation.

Application requirements:

  • Create a queue to hold a list of customers to be processed by a bank teller
  • Create a stack to hold all the customers that have been processed
  • You are going to pre-create about a dozen customer objects and add them to the queue as soon the application starts (in myInitComponents) have some of them set with deposit transaction and others with withdraw transaction with varying amounts
  • The goal is to process each customer in the queue, at a click of a button "start processing next customer"
  • Add the processed client to the stack at a click of another button "processing of the current customer completed"
  • A third button to display all the customers in the queue waiting to be processed and display all the customers in the stack that have been processed. (you would need two JTextArea displays)
  • Everytime a customer is being processed, display in a TextField the next customer waiting to be processed (just the name).

1. Create a project. You can either use a windows app with JFrame, which is recommended or use a console app, but have to use a menu style approach (with Menu and a switch for option selection)

2. Add a class Customer with the following

  • fields: customer_firstname, customer_lastname, accountNumber, currentBalance, transactionAction, and transactionAmount (the transactionAction should be assigned only values: "deposit" or "withdraw". The transactionAmount is the amount this customer wants to deposit or withdraw
  • Constructor
  • Only the getters
  • Methods: deposit() and withdraw()

3. Add the necessary gui (in JFrame) to complete the requirements.

4. Run the completed project.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.