Answer to Question #231673 in Python for hay

Question #231673

 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

1
Expert's answer
2021-08-31T23:51:49-0400
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


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS