Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Where notto eat For this project, you are to create a program that allows users to search through health inspection records of restaurants in NYC

Where notto eat For this project, you are to create a program that allows users to search through health inspection records of restaurants in NYC to help them make more informed choices about their restaurant selections. You are provided with a text file named restaurant_inspections.txt (Posted under Homework and projects in Piazza) containing 100,000 actual inspection reports of a large number of NYC restaurants. Each line contains a single record of an inspection with the following fields: 1) Inspection ID (starting at 0) 2) Restaurant name 3) Borough (Manhattan, Brooklyn, etc.) 4) Cuisine description (Japanese, Chinese, etc.) 5) Inspection date 6) Violation description 7) Score (a lower score corresponds to better sanitary conditions) 8) Grade (A-C) 9) Grade date In a given record, an asterisk (*) separates the fields, and some fields may contain no data or have a special Python value of NaN (Not a Number). There may be multiple inspection records for a given restaurant. Your program will be menu-driven (text-based, not graphical), providing the user with the menu options below. Each will require that you process the contents of the input file. The menu is repeatedly displayed to the user until the user exits the program. This can be easily implemented using a loop. 1) Search by name: show all inspections records for a given restaurant 2) Search by violation description: After the user inputs a search term, the program will display the names of all restaurants whose violation description contains the keyword (the name of a restaurant should only occur once in the output). For instance, if the user inputs rats, the program should display the list of all restaurants where the word rat occurred in the violation description. 3) Generate statistics: When the user selects this option, the program will generate and output the following statistics: a. Top 3 restaurants for each cuisine type (description) based on most recent score (a lower score is better). b. Top 3 restaurants for each borough based on most recent score. c. A count of restaurants by inspection grade and borough (i.e. For each borough, display the count of restaurants receiving an A, B, or C, based on most recent grade. 4) Exit the program. Your implementation may use any part of the Python Standard Library covered in Sections 1-11 in https://docs.python.org/3/library/index.html. No other Python modules may be used.

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

More Books

Students also viewed these Databases questions

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago