# Debug the following program and submit the CORRECT version ####### Lists names = ["chris","dan", "edgar", "bonnie", "al", "fran"] usernames = ["202999", "100345", "299999", "309890", "298765", "345678"] passwords = ["password", "password123", "abcdef", "asdfjkl;", "ilovemom", "abc123"] menuChoice = 0 # user's menu choice ###### functions def printList(list):# print listprintprint(list)print def displayMenu():# displays user-friendly, creative menu printprintprint("******* MENU *******")print("1. (D)isplay list 1 in original order")print("2. D(I)splay list 2 in original order")print("3. (F)ind an item in the list 1")print("4. (L)ogin")print("99. (E)xit")printprint def isFound(list, value):# finds a value in list returns True if found, False otherwiseif (value in list):return Trueelse: return False ###### main program while (menuChoice != "99"):displayMenu()menuChoice = input("Enter a menu choice: ")# handling menu choices if (menuChoice == "10" or menuChoice.upper().strip() == "D"):printList(names)elif (menuChoice == "20"):printList(usernames)elif (menuChoice == "30"):value = input("Enter the value you are searching for: ")if (isFound(names, "Cooper")):print(str(value) + " was found")else:print(str(value) + " was not found") elif (menuChoice == "40"):userInputtedUsername = input("Enter username: ")userInputtedPassword = input("Enter password: ") if (isFound(usernames, userInputtedUsername)):positionInList = usernames.index(userInputtedUsername) if (userInputtedPassword == passwords[positionInList]):print("The username does match the password!")# do something here since the user logged in correctlyelse:print("Invalid Password") else:print("That username does not exist.") elif (menuChoice == "99"):print("Goodbye")breakelse:print("You entered an invalid menu choice.")

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

# Debug the following program and submit the CORRECT version

####### Lists

names = [
"chris",
"dan",
"edgar",
"bonnie",
"al",
"fran"
]

usernames = [
"202999",
"100345",
"299999",
"309890",
"298765",
"345678"
]

passwords = [
"password",
"password123",
"abcdef",
"asdfjkl;",
"ilovemom",
"abc123"
]

menuChoice = 0 # user's menu choice

###### functions

def printList(list):
# print list
print
print(list)
print

def displayMenu():
# displays user-friendly, creative menu
print
print
print("******* MENU *******")
print("1. (D)isplay list 1 in original order")
print("2. D(I)splay list 2 in original order")
print("3. (F)ind an item in the list 1")
print("4. (L)ogin")
print("99. (E)xit")
print
print

def isFound(list, value):
# finds a value in list returns True if found, False otherwise
if (value in list):
return True
else:
return False

###### main program

while (menuChoice != "99"):
displayMenu()
menuChoice = input("Enter a menu choice: ")

# handling menu choices
if (menuChoice == "10" or menuChoice.upper().strip() == "D"):
printList(names)
elif (menuChoice == "20"):
printList(usernames)
elif (menuChoice == "30"):
value = input("Enter the value you are searching for: ")

if (isFound(names, "Cooper")):
print(str(value) + " was found")
else:
print(str(value) + " was not found")

elif (menuChoice == "40"):
userInputtedUsername = input("Enter username: ")
userInputtedPassword = input("Enter password: ")

if (isFound(usernames, userInputtedUsername)):
positionInList = usernames.index(userInputtedUsername)

if (userInputtedPassword == passwords[positionInList]):
print("The username does match the password!")
# do something here since the user logged in correctly
else:
print("Invalid Password")

else:
print("That username does not exist.")

elif (menuChoice == "99"):
print("Goodbye")
break
else:
print("You entered an invalid menu choice.")

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps with 7 images

Blurred answer
Knowledge Booster
List
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