Ad
  • Custom User Avatar
    • typo :

      colo(u)rs -> colors

    • Initial code section :
      `/workspace/node/test.js:6`
      `/*The structure of the flag objects in full_flag_list:`
       `SyntaxError: Invalid or unexpected token`  
      
  • Custom User Avatar

    Task

    Emulate a back ATM Machine and its features with a class.

    Requirements

    Default Settings: new ATM(usersArr) where usersArr is an array of users {username: username, password: password, money: money}

    >> atm = new ATM(users<arr)

    The class will also have the following methods :

    • Register : atm.register(username, password)

      This adds a new user to database with 0$ money, return 0 when done, return 1 when user already exists.

    • Login : atm.login(username, password)

      login a user to do action next, return 0 when done, return 1 when wrong username or wrong password are given

    • Logout : atm.logout():

      logout current user, return 0 when done, return 1 when user already logged out

    • Query Stat : ATM.query()

      query account status, return {money: money} when done, return 1 when user already logged out

    • Change Password : ATM.changePass(oldPass, newPass)

      change password, return 0 when done, return 1 when logged out, return 2 when wrong old password is given

    • Payment : ATM.pay(count, target)

      Payment to another user registered, return new money when done, return 1 when already logged out, return 2 when no enough money, return 3 when target user not exist

    Good luck :-P

  • Custom User Avatar
  • Custom User Avatar

    Good one;) Parental supervision is the ultimate section pass in this bathhouse.

  • Custom User Avatar

    Is the bathhouse gender fluid ? ;)

  • Custom User Avatar

    Seems like to be a bug on your side OR the code indeed had the bug but got fixed

    anyways, couldn't replicate that error for now

  • Custom User Avatar

    done! thanks for also providing the solution!

  • Custom User Avatar

    added tests for checking duplication

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    ah i see , i will add that now. Thanks!

  • Custom User Avatar

    can you please provide an example? also should i add more test cases for duplication cases?

  • Custom User Avatar

    Cases with duplication of integers are not properly tested, and solutions, which fail example tests, may actually pass main test suite.

  • Custom User Avatar

    done!
    thanks!

  • Custom User Avatar

    indention to be corrected for last line of random tests.

  • Custom User Avatar

    fixed!
    thanks!

  • Loading more items...