computer science

You are required to use the Account class to simulate an ATM machine. Create ten accounts in an array with id 0, 1, 2 ...9, and initial balance $50. The system prompts the user to enter an id. If the id is entered incorrectly, ask the user to enter a correct id. Once an id is accepted, the main menu is displayed as shown in the sample run. You can enter a choice 1 for viewing the current balance, 2 for withdrawing money, 3 for depositing money, and 4 for exiting the main menu. If the user tries to withdraw more money than is available, the program reports a “Not enough funds.” message. Once you exit, the system will prompt for an id again. So, once the system starts, it will not stop. To exit the program the user must -1 when an id is requested.


asked by karen

Respond to this Question

First Name

Your Answer

Similar Questions

  1. computer code

    Create a Flowchart and pseudocode. Create a class whose main method creates three arrays. The first array will contain five kinds of flowers - petunia, pansy, rose, violet, and carnation. The second array will contain the cost of
  2. Java programming

    Write a Java program that stores Customer accounts with the attributes: (i) Name of the depositor (ii) Account number (iii) Type of account (iv) Balance amount And the methods: (i) Deposit (ii) Withdraw (iii) Display the balance
  3. Java programming

    can u give me some example of withdrawal money program using array to store ten information of user. including the attributes: (i) Name of the depositor (ii) Account number (iii) Type of account (iv) Balance amount And the
  4. Linux

    you will design and implement a script that operates an ATM machine. Your script should be able to let users withdrawn money from their checkings or savings account, transfer money between accounts, and check the accounts'
  5. Java

    Design a flowchart for a program that prompts the user to enter ten numbers one at a time. After the user has entered all ten number the program will then print out the total of those ten number and quit.
  6. Flowcharts and pseudocode

    Create a class whose main method creates three arrays. The first array will contain five kinds of flowers - petunia, pansy, rose, violet, and carnation. The second array will contain the cost of each flower, respectively, 50
  7. computer science

    Please design the ¡§Classes¡¨ that will work together for the implementation of the User Case ¡§Validate User¡¨ in the ATM machine. its just want us o write a diagram..
  8. Java Computer Science

    Say I write an application that prompts the user to enter an integer. If the user enters a double or string or anything, anything not an integer an error will appear. I'm having trouble writing code to combat this problem so I can
  9. Computer Programming

    Create the flowchart and algorithm for a module that will prompt the user to enter the amount of cash they have in their pocket. The program should output “Not Enough” ($0 - $0.64), “Vending Machine” ($0.65 - $1.99),
  10. programming

    How to write a program to create a class roster using an array? The program prompts the teacher to enter student’s names and GPA values. Display the results.

More Similar Questions