Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!doctype html>
- <html>
- <head>
- <title>oh</title>
- <h2>Bank Machine</h2>
- <img src="https://www.riobk.com/ContentImageHandler.ashx?ImageId=76121"alt="Welcome to our bank">
- </head>
- <body>
- <script type="text/javascript">
- //variable
- var accountname = 5;
- var accountpass = 6;
- var count = 3;
- //array
- var matrix = [
- ["Mr", "John", "Smith", 46, 10000, "smith_j", "welcome"],
- ["Ms", "N", "Painchaud", 21, 60000, "MsP", "hurtyou"],
- ["Mrs", "Julie", "Donner", 45, 500, "dontlknow", 1234],
- ["Mrs", "T", "Wit", 34, 350, "twit", "nuunuu"]];
- //
- // FUNCTION DECLARATIONS
- //
- function login() {
- for (var row = 0; row < matrix.length;row++)
- {
- if ((username == matrix[row][5]) && (password == matrix[row][6]))
- {
- alert("Welcome! " + matrix[0][5] + ".");
- }
- }
- alert("incorrect!");
- count--;
- }
- function disaster() {
- do {
- var disaster = prompt("Do you want to check your withdrawal (1)? deposit (2) or balance (3)");
- switch(disaster)
- {
- case"1":
- withdrawal();
- again=2;
- break;
- case"2":
- deposit();
- again=2;
- break;
- case"3":
- balance();
- again=2;
- break;
- default: var again=1;
- }
- } while(again=1);
- }
- function withdrawal() {
- var money = prompt("How much?");
- money = parseInt(money)
- if (matrix[accountname][accountpass]-money<0)
- alert("You don't have enough funds!")
- var w = prompt("try again? yes or no?");
- if (w == "yes") withdrawal();
- else {
- matrix[accountname][accountpass]=money;
- alert("Your new balance is "+matrix[accountname][accountpass]);
- }
- }
- function deposit() {
- var amount = prompt("How much?");
- benefit = parseInt(benefit);
- }
- function antransaction() {
- uantransction = prompt("Do you want another transaction?");
- return uantransction;
- }
- function balance() {
- do {
- alert("Your current balance is $" + balance + ".");
- } while (antransaction())
- }
- function nontransaction() {
- var printout = prompt("Do you want a printout of your transaction?")
- if (printout == "yes")
- alert("Thank you!!")
- else
- document.write("Your balance is $" + hahabalance + ".")
- }
- //
- // RUN THE SCRIPT AT PAGE LOAD
- //
- while (count > 0) {
- //entering user name and password
- var username = prompt("Give me a username, welcome");
- var password = prompt("type your password, please! you only have three chances!!!!!!!!!!!!!!");
- login();
- }
- </script>
- </body>
- </html>
Add Comment
Please, Sign In to add comment