ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 2 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 29 Apr 2017 My Price 8.00

Write a complete Java program called AtmSimDoLoop

Write a complete Java program called AtmSimDoLoop that simulates a simple ATM according to the following guidelines.

The program should start with an initial account balance, which you can set to any legitimate double value. It should use a do loop to prompt the user with the following starting prompt (without the dashed lines) until the user enters 4 to quit.

Enter the number of your desired transaction type.

  1. Balance
  2. Deposit
  3. Withdrawal
  4. Quit
  • If a balance is requested, the program should output “Your current balance is X.” where X is the current balance (including updates if other transactions have been made), and then repeat the starting prompt for the user.
  • If a deposit is requested, prompt the user to enter the amount of the deposit (use a double for this). Add the deposit amount to the current balance and then print “Your current balance is X.” where X is the new balance after the deposit, and then repeat the starting prompt for the user.
  • If a withdrawal is requested, prompt the user to enter the amount of the withdrawal (use a double for this). If the proposed withdrawal amount is less than or equal to the initial balance,  print “Your current balance is X.” where X is the new balance after the withdrawal, and then repeat the starting prompt for the user. If the proposed withdrawal amount exceeds the current balance, print “Insufficient funds. Your current balance is X.” where X is the current balance before the attempted withdrawal, and then repeat the starting prompt for the user.
  • If “Quit” is requested, the program should print “Good-bye.” and then stop.

Thoughts

  • Note that you need to keep track of the current balance during each iteration of the loop.
  • Before you begin coding, sketch out the logic that will handle each condition appropriately.
  • Note that this simple ATM simulator handles, for simplicity, just a single transaction of Balance, Deposit, or Withdrawal

Answers

(11)
Status NEW Posted 29 Apr 2017 07:04 AM My Price 8.00

-----------

Not Rated(0)