Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
Task
Emulate a back ATM Machine and its features with a
class
.Requirements
Default Settings:
new ATM(usersArr)
whereusersArr
is anarray
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, return0
when done, return1
when user already exists.Login :
atm.login(username, password)
login a user to do action next, return
0
when done, return1
when wrong username or wrong password are givenLogout :
atm.logout()
:logout current user, return
0
when done, return1
when user already logged outQuery Stat :
ATM.query()
query account status, return
{money: money}
when done, return1
when user already logged outChange Password :
ATM.changePass(oldPass, newPass)
change password, return
0
when done, return1
when logged out, return2
when wrong old password is givenPayment :
ATM.pay(count, target)
Payment to another user registered, return new money when done, return
1
when already logged out, return2
when no enough money, return3
when target user not existWhat does this mean?
I propose you use an AI tool to review your descriptions. Most of your sentences are a bit iffy.
yep, thanks for notice
Is this report any different than this other one? https://www.codewars.com/kata/54f6e7a62e2c167e29000112/discuss#66a3eb176427fb4c616e6f5c
Hello,
Lots of issues here... I confess I don't like the general idea in the first place ("yet another bank account problem :rolleyes:")
{error: number}
Cheers
This comment is hidden because it contains spoiler information about the solution
The sample test has a syntax error
You can republish when you're ready to move this kata from a draft state back to a beta state.
Just so we're clear: as long as pigs start to breed before they die (13 days for boars and 14 days for sows), they'll successfully breed a new piglet (and then immediately die)?
The two problems you wrote was all fixed just now
Thank for your notices, i will fix error you said, if you willing, you can help me make description more clear
Fixed
The description is lacking key details and is under-defined. For example, the mechanics for how breeding works isn't entirely clear. Can a boar be 12 days old and still breed with a sow (meaning the boar would technically die during the breeding process), or do we need to factor in the age of death of the pigs before breeding begins? The pig type upon breeding isn't entirely clear either. You say it alternates, but does that mean it alternates globally, or for each new batch of breeding?
sample tests are missing
const {assert} = require('chai');
Fixed
no sample tests