2022-03-21

Where to start with a simple banking app? [closed]

I'm working through a course on JavaScript currently and honestly I'm having a pretty difficult time with it. If anyone has any resources they could recommend for learning, I'd appreciate it!

I'm trying to make a simple banking app with these requirements:

  • The user should see a prompt so they can type which action to perform.

  • The user will have a list of 4 actions to choose from.

  • Enter Q to quit (immediately quits the program).

  • Enter W to withdraw.

    • The user will be prompted again to enter an amount to withdraw. After withdrawing money, they should be able to type another option.
  • Enter D to deposit.

    • The user will be prompted again to enter an amount to deposit. After depositing money, they should be able to type another option.
  • Enter B to view balance.

    • The user will see their balance. Afterwards, they should be able to type another option.
  • The balance should update after any Withdrawal or Deposit transactions.

  • The program will loop asking for input until the user enters Q.

Here's my basic HTML for a very simple site

<!DOCTYPE html>
<html lang="en" dir="ltr">
  <head>
    <meta charset="utf-8">
    <title></title>
  </head>
  <body>
    <h1>Welcome!</h1>
    <button onclick="start()">Click here to get started.</button>
    <script src="scripts.js"></script>
  </body>
</html>

And here's as far as I've been able to get with the JS...

function start() {
  let input = prompt('What would you like to do?');

  if input = 'w' {
    alert('Withdraw');
  } else () {

  }
}

And I know that's probably not even the direction I need to be going. I'm honestly stuck because I don't really know where to start. Any and all advice is much appreciated, TIA!!



No comments:

Post a Comment