1.12 Lab: Check Login Credentials (classes) Complete the Login class implementation. For the class method check_credentials(), you will need to accept two arguments - login and passwd. Do not forget about the self argument. This class method will set two local variables simlogin = Test' and simpass = "test1234". These variables will simulate the correct login and password for the credential check process. The method will receive the login and password from the user and check it with Test and test1234. If the user sent the correct credentials output: Successful login! If the user sent the correct login name but the wrong password output: Login name is correct, incorrect password! If the user sent an incorrect login name but the correct password output: Login name is incorrect, password accepted! If the user sent both incorrect login name and password output: Unsuccessful login attempt! The class method will return a boolean success variable as True if the login was successful. Using if name "__main__" to control the flow of your code, add a loop that will stop the process if the user attempts more than 5 login attempts. Ex: If the input is: Testit test And this is their first incorrect attempt. The output is: Unsuccessful login attempt! Try again - you have 4 attempts left! If the input is: Test test1234 == The output is: Successful login!

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
I need help with this lab which is 1.12 lab check login credentials (classes) The current code that I have is incorrect and it’s not passing the tests for the lab. Can you please revise the current code.  current code: # class Login class Login(): #Constructor def init (self): # setsid, password to default values self.simLogin="Test" self.simpass="test1234" # check credentials () method accepts user id, password # as function arguments and checks it with default values def check credentials(self, Id, Pass) : #if userId, Password both are correct, login success if(self.simLogin==Id and self.simpass==Pass): print ("Successful login!") return True #if userId is correct and wrong password elif(self.simLoqin==Id and self.simpass!=Pass): print ("Login name is correct, incorrect password!") return False #if userId wrong and valid password elif (self.simLoqin!=Id and self.simpass==Pass): print ( "Login name is incorrect password accepted!") return False #If both userId and password are wrong else: print ( "Unsuccessful login attempt!") return False #driver code if name ==' main # creating a Login class object userl userl= Login( ) # Declaring a variable count keep # track of login attempts count=0 # while loop iterates till user enter valid # credentials or user enter invalid details 5times while(count
1.12 Lab: Check Login Credentials (classes)
Complete the Login class implementation. For the class method check_credentials(), you will need to
accept two arguments - login and passwd. Do not forget about the self argument.
This class method will set two local variables simlogin = "Test' and simpass = "test1234".
These variables will simulate the correct login and password for the credential check process.
The method will receive the login and password from the user and check it with Test and test1234.
If the user sent the correct credentials output:
Successful login!
If the user sent the correct login name but the wrong password output:
Login name is correct, incorrect password!
If the user sent an incorrect login name but the correct password output:
Login name is incorrect, password accepted!
If the user sent both incorrect login name and password output:
Unsuccessful login attempt!
The class method will return a boolean success variable as True if the login was successful.
Using if __name__ == "__main___" to control the flow of your code, add a loop that will stop the process if the
user attempts more than 5 login attempts.
Ex: If the input is:
Testit
test
And this is their first incorrect attempt. The output is:
Unsuccessful login attempt!
Try again - you have 4 attempts left!
If the input is:
Test
test1234
The output is:
Successful login!
Transcribed Image Text:1.12 Lab: Check Login Credentials (classes) Complete the Login class implementation. For the class method check_credentials(), you will need to accept two arguments - login and passwd. Do not forget about the self argument. This class method will set two local variables simlogin = "Test' and simpass = "test1234". These variables will simulate the correct login and password for the credential check process. The method will receive the login and password from the user and check it with Test and test1234. If the user sent the correct credentials output: Successful login! If the user sent the correct login name but the wrong password output: Login name is correct, incorrect password! If the user sent an incorrect login name but the correct password output: Login name is incorrect, password accepted! If the user sent both incorrect login name and password output: Unsuccessful login attempt! The class method will return a boolean success variable as True if the login was successful. Using if __name__ == "__main___" to control the flow of your code, add a loop that will stop the process if the user attempts more than 5 login attempts. Ex: If the input is: Testit test And this is their first incorrect attempt. The output is: Unsuccessful login attempt! Try again - you have 4 attempts left! If the input is: Test test1234 The output is: Successful login!
earn.zybooks.com/zybook/CYB_135_56153800/chapter/1/section/12
ary> CYB 135: Object-Oriented Scripting Language Il home > 1.12: Lab: Check Login Credentials (classes)
Input
Your output
Your output does not
contain
2:Compare output A
Input
Your output
Your output does not
contain
Test
test1234
Enter user id: Enter password: Successful Login!
Successful login!
Testit
test
Testing
testit
Tesla
tesla
test
test234
nottesting
test000
Enter user id: Enter password: Unsuccessful Login attempt!
Enter user id: Enter password: Unsuccessful Login attempt!
Enter user id: Enter password: Unsuccessful Login attempt!
Enter user id: Enter password: Unsuccessful Login attempt!
Enter user id: Enter password: Unsuccessful Login attempt!
Testit test
Unsuccessful login attempt!
Try again you have
Testing testit
-
Unsuccessful login attempt!
Try again
Tesla tesla
4 attempts left!
Unsuccessful login attempt!
Try again you have
test test234
-
you have 3 attempts left!
-
2 attempts left!
Unsuccessful login attempt!
Try again you have
nottesting test000
Unsuccessful login attempt!
1 attempts left!
0/2
Mi
Transcribed Image Text:earn.zybooks.com/zybook/CYB_135_56153800/chapter/1/section/12 ary> CYB 135: Object-Oriented Scripting Language Il home > 1.12: Lab: Check Login Credentials (classes) Input Your output Your output does not contain 2:Compare output A Input Your output Your output does not contain Test test1234 Enter user id: Enter password: Successful Login! Successful login! Testit test Testing testit Tesla tesla test test234 nottesting test000 Enter user id: Enter password: Unsuccessful Login attempt! Enter user id: Enter password: Unsuccessful Login attempt! Enter user id: Enter password: Unsuccessful Login attempt! Enter user id: Enter password: Unsuccessful Login attempt! Enter user id: Enter password: Unsuccessful Login attempt! Testit test Unsuccessful login attempt! Try again you have Testing testit - Unsuccessful login attempt! Try again Tesla tesla 4 attempts left! Unsuccessful login attempt! Try again you have test test234 - you have 3 attempts left! - 2 attempts left! Unsuccessful login attempt! Try again you have nottesting test000 Unsuccessful login attempt! 1 attempts left! 0/2 Mi
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Knowledge Booster
Class
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education