Question: Language is based on python 3. [total: 12] In this problem, you will design the data structure for implementing an ADT called RESTAURANT-SET. Below is

Language is based on python 3. [total: 12] In this problem, youLanguage is based on python

3. [total: 12] In this problem, you will design the data structure for implementing an ADT called RESTAURANT-SET. Below is the description of the ADT. Objects: A collection of restaurants in the same city. Each restaurant has the following attributes: restaurant.name: a string which is the name of the restaurant. Each restaurant has a unique name, i.e., no two restaurants have the same name. restaurant.cost: a decimal value such as 22.99 that denotes the cost of a 1 person meal at the restaurant. For simplicity, assume that each restaurant's cost is unique, i.e., no two restaurants have the same cost. restaurant.rating: a decimal value between 0.0 and 5.0, e.g., 0.012, 3.1415926. For simplicity, assume that each restaurant's rating value is unique, i.e., no two restaurants have the same rating value. Operations: GET-RESTAURANT (R, name): returns the restaurant with name name if it exists in the RESTAURANT-SET R; returns NIL if the restaurant does not exist in R. ADD-RESTAURANT (R, restaurant): Add a restaurant restaurant to the RESTAURANT-SE R. You may assume that restaurant has a unique name, a unique cost and a unique rating. AVG-COST(R, ri, r2), r1 3 and

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!