Assignment 3 – Checking Passwords

Maximum Points = 50

 The purpose of this lab is to continue your study of computer programming and algorithms through the Python programming language. In this lab you will use several new features including – lists, reading and writing files.

 

Write a program that reads usernames and passwords from a file and stores them in a list. Then ask the user for their username and password and provide the appropriate response.

 

Your program must have these features:

 

  1. A function that receives the name of a text file (I will use a file named.password.txt) consisting of pairs of data: username & password, e.g.

Wayne 1234

Sue password

 

  1. Your function must return a list containing these pairs
  2. Interactively ask the program user for their username and password, compare with the names and passwords in the list and print an appropriate message. You may use assume the usernames are unique.
  3. Allow the program to run, asking for username & password until the user tells your program to stop.

 

EXTRA: Add a function that allows the user to add a new username, password pair

 

Make sure that your program uses proper indentation and complete documentation. See http://csc.columbusstate.edu/summers/NOTES/1301/style.htm for guidelines.

The program heading should occur at the top of the program and should include:

               #============================
               # PROGRAM SPECIFICATIONS
               # NARRATIVE DESCRIPTION:
                #
                #  @author (your name) 
               #  @version(date)
               #==============================

 

 

 (Due before 8 am on Wednesday, February 1, 2012) Submit your .py file containing your program and your timesheet documenting your time to the dropbox in WebCT..

 Grades are determined using the following scale:

Grading Rubric  (Word document)