Question: Task Description Create a Restaurant class to be a blueprint for all the restaurants that are managed on the board. Attributes Restaurant will need the



Task Description Create a Restaurant class to be a blueprint for all the restaurants that are managed on the board. Attributes Restaurant will need the following class variables: - RESTAURANT_TYPES list of strings set to a list of the four types of restaurants found in Task 2 in alphabetical order. Restaurant will need the following instance variables. Its constructor method will have 4 arguments for the first four instance variables: - restaurant_name the string name of the restaurant. - restaurant_type the string representing the type of the restaurant. - restaurant_price the integer representing the amount of BiteCoins needed to become a manager of the restaurant. - board_position the integer board position of the restaurant. - managers_list the list containing all RestaurantManager objects representing the manager(s) managing the restaurant. It is initialised as an empty list. i Do not add any more Restaurant instance variables aside from the 5 above. Restaurant Getter Methods Create the following methods that interacts with the restaurant's instance variables: - Five methods where each method will return the value of a specific instance variable. Each method should use the following naming convention get_nameofvariable where nameofvariable is the name of the instance variable. i You must access all Restaurant instance variables using these getter methods instead of accessing them directly, even within other methods. Restaurant Update \& Other Retrieval Methods Each restaurant can be managed by up to 3 managers. Recall the boards in Task 1. Using this board as an example, the three symbols printed in each position represent the managerial symbols. At the start of the game, managers take turns moving around the board to buy the right to manage each restaurant upon landing on it. Each restaurant can have up to three managerial shares, allowing one to three different managers to potentially buy the right to manage the restaurants. The first symbol in each row represents the first manager who bought the right to manage the restaurant, earning a 40% share. The subsequent two symbols represent the next managers, each earning a 30% share. - Position 1: "B C C" means Manager B bought first and has a 40% share, whilst C bought twice after and has a 60% share. - Position 7: "B B B" means Manager B is the sole manager and has 100% share. - Position 5: If Manager A bought first and third, we will move the second A symbol next to the first i.e. "A A D". A has 70\% and D has 30\% share, respectively. Implement the following methods: - has_manager_avai lability which checks that there is still availability for more managers. - add_new_comanager which takes in a manager (i.e. RestaurantManager object) and adds it to the appropriate instance variable. - has_sole_manager which checks that a restaurant is managed by only 1 manager. - get_managerial_share which takes in a manager (i.e. RestaurantManager object) and returns that manager's integer percentage of managerial shares e.g. 70 . i You must update or interact with relevant Restaurant instance variables using these methods instead of updating them directly, even within other methods. Look at the examples below to see how the methods are used. String Representation of Objects You will need the __str_-_ magic method to use print() or str () on our Restaurant objects. Implement ___str__ in the Restaurant class by returning the name of the restaurant. __repr_-_ should simply return self.__str__(), which allows you to see the same string of your Restaurant rather than 0000001232455678 > in the error log or when printing the manager directly. task4.py class Restaurant: \#remove pass and add your code here pass class RestaurantManager: "I" " " DUMMY CLASS You may leave this blank as your Restaurant Class will still work with this class left empty. "I" " pass \#used for manual testing purpose if __name___== "__main__": restaurant1 = Restaurant("Wok This Way", "Fusion Cuisine", 80, 15) print(restaurant1.get_restaurant_name ()) print(restaurant1.get_managers_list()) print(restaurant1.has_manager_availability ())
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
