def getInput(): return int(input("Enter a call number: ")) def findBook (callNumber): if callNumber> 699 and callNumber <751: return elif (callNumber > 500 and callNumber < 901) and not (callNumber > 699 and callNumber < 751): elif (callNumber> 199 and callNumber < 501) or callNumber > 900: return return elif callNumber > 99 and callNumber < 200: return else: return def displayResult(result): print("Result for you request: ", result) def main(): print("Enter -1 to exit application \n") main() callNumber getInput() while callNumber != -1: locationOfBook findBook (callNumber) displayResult(locationOfBook) callNumber get Input () print("Good-bye!")
Code is in Python
Write an application that allows the user to enter a call number of a book, and if the book is
located, the location will be displayed. The application will continue to ask the user for a call
number until the user enters -1 to exit the application. Below is the call number
legend you will need to return the correct output. Make sure to pay close attention
to the conditional requirements for each output.
Call Numbers and their locations are:
99 and below = Book not found!
100-199 = Basement
200-500 and over 900 = Main Floor
501-900 except 700-750 = Upper Floor
700-750 = Archives
Copy the source code give in the picture. NOTE: The application won’t return the correct
output until you add them accordingly
Use the call number legend table above to return the correct outputs. Currently,
the application will return empty strings for each. It is your task to enter the
correct output based on the conditional criteria.
Step by step
Solved in 4 steps with 2 images