NEA Support

Below is a series of different programs that have pseudocode and flowcharts completed for them. Use them to try and relate your algorithm designs to your code.

Example 5 - Login System - Reading from a File

This program is designed to show how you might create a login system which reads from a text file.

Flowchart




Pseudocode


Python Code

			
username = input("Please enter your username (email address): ")
password = input("Please enter your password: ")
file=open("Logins.csv","r")
found = False
for line in file:
    details=line.split(",")
    if details[0] == username and details[1] == password:
    	found = True
    	print("Email: " + details[0])
    	print("Name: " + details[2] + " " + details[3])
    	print("Address:\n" +details[4] +"\n"+details[5]+"\n"+details[6])
if found == False:
	print("Incorrect login details entered")