Question: Due: due in lab In-lab assignment # 2 Topics: class, object, instantiation, print Problem Statement: In this assignment, we will be designing a simple authentication

 Due: due in lab In-lab assignment # 2 Topics: class, object,

Due: due in lab In-lab assignment # 2 Topics: class, object, instantiation, print Problem Statement: In this assignment, we will be designing a simple authentication system. Authentication is the process of validating a user, hence it requires a username and password like any web system we use. The purpose of this lab is to gain experience in python's basic class definition and object instantiation. Class Definition: You need to write a simple class 'User, where the class will have following instance variables and methods 1. Instance variables: username and password, both of string type. 2. _init_method: constructor method to initialize instance variables. 3. trmethod: Print representation of User object. The str function should print the username and password. Since password is a private information, it needs to be encrypted. For encryption the program will be using a simple scheme. The program will print password as series of asterisk and length of the series will be the length of the password. For example, user John' has a password 1234567. So, the password will be printed as 7 asterisk. Please see below for a sample output. (Hint: 5*'A' will print 'A' five times) in a class Object Creation/Instantiation: You need to create two objects 'ul and u2' of 'User class where the username of ul is John' and password is '1234567. The second object u2 will have the username of 'peter and password is 123456 Sample output: username: john password: username: peter password: Submission: 1. All submission will be via BlackBoard during the lab time 2. You can take help from the GTA, you can look at the class slides and lecture codes But 3. The codes need to be written in the firstname lastname ILA2.py file. Please change the name of the file and the header of the file

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!