Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

last pic is the given default code. Restaurant Getter Methods Create the following methods that interacts with the restaurant's instance variables: - Five methods where

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

last pic is the given default code.

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. restaurant1 = Restaurant("Wok This Way", "Fusion Cuisine", 80, 15) print(restaurant1.get_restaurant_name()) print(restaurant1.get_managers_list()) print(restaurant1.has_manager_availability ()) Wok This Way [] True Adding 1 manager to a restaurant three times: \#do not modify Dummy Class dummy_manager1 = RestaurantManager ( ) dummy_manager2 = RestaurantManager () restaurant1.add_new_comanager(dummy_manager1) print(restaurant1.get_managers_list()) restaurant1.add_new_comanager(dummy_manager 1 ) print(restaurant1.get_managers_list()) restaurant1.add_new_comanager(dummy_manager 1 ) print(restaurant1.get_managers_list()) print(restaurant1.has_sole_manager ( )) print(restaurant1.get_managerial_share(dummy_manager1)) print(restaurant1.get_managerial_share(dummy_manager2)) \#take note your object addresses may differ from the example given [0x7 f25e546c0d0>] [07 f25e546c0d0>, 07f4e4 caf4210>] [07f4e4caf4210>

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Donald A. Carpenter Fred R. McFadden

1st Edition

8178088045, 978-8178088044

More Books

Students also viewed these Databases questions