requires python to answer
Please find the required solution for a (Please post the rest of the them as separate question) # define arrays for available rooms, booked rooms (initially all rooms are available) available_rooms = [1, 2, 3] booked_rooms = [] # define method for print menu def print_menu(): print("1. Book a Study Room") print("2. Release a Study Room") print("0. Exit") # print available rooms with label "Room" def print_available_rooms_list(): if len(available_rooms) == 0: print('No Available Rooms') return print("Available Rooms") for i in available_rooms: print('Room ', i, end='\t') print() # print available room numbers def print_available_rooms(): if len(available_rooms) == 0: print('No Available Rooms') return print("Available Rooms") for i in available_rooms: print(i, end='\t') print() # print booked rooms with label "Room" def print_booked_rooms(): if len(booked_rooms) == 0: print('No Booked Rooms') return print("Booked Rooms") for i in booked_rooms: print(i, end="\t") print() # print booked room numbers def print_booked_rooms_list(): if len(booked_rooms) == 0: print('No Booked Rooms') return print("Booked Rooms") for i in booked_rooms: print('Room ',i, end="\t") print() # method to book room on required input def book_room(): if len(available_rooms) == 0 : print('No study room available currently') return elif len(available_rooms) == 1: print('Only room ', available_rooms[0], ' is available') inp = input('Proceed? y/n:') if inp == 'y': process_book_room(available_rooms[0]) else: print_available_rooms_list() inp = int(input('Select a room or -1 to quit room booking:')) if inp == -1: print("Booking room is abondoned.") return elif inp not in available_rooms: print("select valid available room number or -1 to quit room booking") book_room() return else: process_book_room(inp) print("Room is successfull Booked") print_booked_rooms() print_available_rooms() def process_book_room(room_number): available_rooms.remove(room_number) booked_rooms.append(room_number) def process_release_room(room_number): available_rooms.append(room_number) booked_rooms.remove(room_number) # method for release room def release_room(): if len(booked_rooms) == 0: print('There is currently no room booking') else: print_booked_rooms_list() inp = int(input("Enter the room number to release:")) if inp not in booked_rooms: print('There is no booking in this study room') else: process_release_room(inp) print('Room is successfully released') print_booked_rooms() print_available_rooms() # main method to simulate the booking def main(): print_menu() opt = int(input("enter choice:")) if opt == 1: book_room() elif opt == 2: release_room() elif opt == 0: print("Application Exiting.") return else: print('Invalid choice.') main() main() sample output:
requires python to answer (a) A school library has 3 study rooms available for students to book during its opening hours, on a first-come-first-serve basis. Assume there is no pre-booking, that...
Write a program in Java, Python and Lisp When the program first launches, there is a menu which allows the user to select one of the following five options: 1.) Add a guest 2.) Add a room 3.) Add a booking 4.) View bookings 5.) Quit The functionality of these options is as follows: 1.) When users add a guest they provide a name which is stored in some manner of array or list. Guests are assigned a unique ID...
making a file You are tasked with creating a text-based program for storing data on Hotel Room Bookings - however, as this is a comparative languages course, you will be creating the same application in the following three programming languages: • Java, • Python, and • Lisp As you implement the application in each language you should keep notes on: - The features of the languages used, - Which features you found useful, and - Any issues or complications which...
First, read the article on "The Delphi Method for Graduate Research." ------ Article is posted below Include each of the following in your answer (if applicable – explain in a paragraph) Research problem: what do you want to solve using Delphi? Sample: who will participate and why? (answer in 5 -10 sentences) Round one questionnaire: include 5 hypothetical questions you would like to ask Discuss: what are possible outcomes of the findings from your study? Hint: this is the conclusion....