Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need help with java... The code that i have done isnt accepted by my tester... here's the java problem... You are writing a small
I need help with java... The code that i have done isnt accepted by my tester...
here's the java problem...
You are writing a small section of an ATM machine where you accept a string that is a password and accept it or reject it. If the user tries more than three times with a bad password the card is blocked and no password will be accepted until the resetPasswordAttempts method is called. The password must be fixed at 1234 The object to implement this is referred to as AtmPin and consists of the following public methods: - public AtmPin0 Creates an AtmPin object. -public boolean verifyPinCode(String code) - Accepts a string which represents the password attempt. If the string matches the password (which is fixed at 1234) then the method returns true, otherwise it returns false - public boolean isBadPassword True when a bad password is passed to acceptPinCode. Updated every time a password is passed to acceptPinCode. Note that you can have a good password but it is not accepted by the system (acceptPinCode returns false) since the password is blocked. - public boolean isBlocked0 - If more than three attempts are made then the password is not accepted (acceptPinCode returns false) until resetPasswordAttempts is called - public void resetPasswordAttempts(0 Resets the number of attempts to zero. Your Main.java should contain code to test your AtmPin object. Be sure to test the cases where you are blocked and send it a good password. It should still reject the password but isBadPassword will return false You are writing a small section of an ATM machine where you accept a string that is a password and accept it or reject it. If the user tries more than three times with a bad password the card is blocked and no password will be accepted until the resetPasswordAttempts method is called. The password must be fixed at 1234 The object to implement this is referred to as AtmPin and consists of the following public methods: - public AtmPin0 Creates an AtmPin object. -public boolean verifyPinCode(String code) - Accepts a string which represents the password attempt. If the string matches the password (which is fixed at 1234) then the method returns true, otherwise it returns false - public boolean isBadPassword True when a bad password is passed to acceptPinCode. Updated every time a password is passed to acceptPinCode. Note that you can have a good password but it is not accepted by the system (acceptPinCode returns false) since the password is blocked. - public boolean isBlocked0 - If more than three attempts are made then the password is not accepted (acceptPinCode returns false) until resetPasswordAttempts is called - public void resetPasswordAttempts(0 Resets the number of attempts to zero. Your Main.java should contain code to test your AtmPin object. Be sure to test the cases where you are blocked and send it a good password. It should still reject the password but isBadPassword will return falseStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started