Create an object based on the PriceChecker class
checkerObj = PriceChecker()
# Load levelsList from the records in levelsFile
checkerObj.readLevelsFromFile()
# Display the levelsList and get user input for what actions to take
userInput = 99
while userInput != 0: checkerObj.displayList()
userInput = checkerObj.displayMenu()
if(userInput == 1):
checkerObj.addLevel()
checkerObj.writeLevelsToFile() # Write levelsList to LevelsFile
elif(userInput == 2):
checkerObj.removeLevel()
checkerObj.writeLevelsToFile() # Write levelsList to LevelsFile
elif(userInput == 3):
checkerObj.removeAllLevels() checkerObj.writeLevelsToFile() # Write levelsList to LevelsFile
checkerObj = PriceChecker()
# Load levelsList from the records in levelsFile
checkerObj.readLevelsFromFile()
# Display the levelsList and get user input for what actions to take
userInput = 99
while userInput != 0:
checkerObj.displayList()
userInput = checkerObj.displayMenu()
if(userInput == 1):
checkerObj.addLevel()
checkerObj.writeLevelsToFile() # Write levelsList to LevelsFile
elif(userInput == 2):
checkerObj.removeLevel()
checkerObj.writeLevelsToFile() # Write levelsList to LevelsFile
elif(userInput == 3):
checkerObj.removeAllLevels()
checkerObj.writeLevelsToFile # Write levelsList to LevelsFile
Comments
Leave a comment