This commit is contained in:
Jidong Xiao
2024-02-08 16:57:52 -05:00
3 changed files with 14 additions and 2 deletions

View File

@@ -240,7 +240,7 @@ README.txt file.
- No reflection. (-1)
- OVERALL CLASS DECLARATION & IMPLEMENTATION AND CODING STYLE (8 pts)
- No credit (significantly incomplete implementation) (-8)
- Putting almost everything in the main function. It's better to create separate functions for different tasks. (-2)
<!--- Putting almost everything in the main function. It's better to create separate functions for different tasks. (-2)-->
- Improper uses or omissions of const and reference. (-1)
- Function bodies containing more than one statement are placed in the .h file. (okay for templated classes) (-2)
- Functions are not well documented or are poorly commented, in either the .h or the .cpp file. (-1)

View File

@@ -57,10 +57,12 @@ Keep in mind that users can select multiple categories, in the above two screens
If multiple categories are supplied from the command line, these categories will be separated by a single space. To simplify your command line processing logic, you can assume that our test cases would only use a category if it contains one single word, and that means, we might test the category of "Pizza", "Japanese", "Barbeque", "Indian", "Chinese", but we would not test "Sushi Bars" - because it contains more than one word.
When your program is executed, it produces the businesses which fall into any of the chosen categories, and are located in this zipcode area. For each business, your program will print to the output file something similar to what Yelp does. The following is an example:
When your program is executed, it produces the businesses which fall into any of the chosen categories, and are located in this zipcode area. For each business, your program will print to the output file something similar to what Yelp does. The following is an example from Yelp:
![alt text](images/alibaba.jpg "Alibaba")
All expected output files are provided, refer to these expected output files for the exact format.
The businesses showed in your output file should be sorted based on the rating of the business, with higher rated businesses being showed before lower rated businesses. For any two businesses which have the same rating, for example, both are 4.5, then in your output file, keep the order of these two as they appear in the input file.
In the case where no matching businesses can be found, your program should print a message similar to what Yelp does:
@@ -73,6 +75,16 @@ This message should be printed into the output file. For your reference, this is
![alt text](images/yelp_no_results.jpg "Yelp no results found")
### The Price Range
In Yelp, the "$" sign is commonly used to indicate the price range for businesses. It helps users quickly gauge the approximate cost of dining or using services at a particular establishment. There are four levels, represented by "$", "$$", "$$$", and "$$$$" respectively. A single "$" indicates that the business is relatively inexpensive, with prices typically ranging from low to moderate. A "$$$$" sign represents the highest price range level, indicating that the business is quite expensive.
In the input json file, the *RestaurantsPriceRange2* field is used for this purpose. The value of this field ranges from 1 to 4. With 1 being the least expensive and 4 being the most expensive. Therefore, for a business whose *RestaurantsPriceRange2* is 1, your program should print a "$" sign; for a business whose *RestaurantsPriceRange2* is 2, your program should print a "$$" sign; etc.
In the case where the *RestaurantsPriceRange2* field does not exist, your program should not print any "$" sign; for your reference, the following is an example from Yelp in which no "$" sign is displayed.
![alt text](images/yelp_no_price.png "Yelp no price")
## Provided Code
Several helper functions are provided for you to parse the json file. All of them expect the caller to provide the one line from the json file as the sole argument, in the format of an std::string.

Binary file not shown.

After

Width:  |  Height:  |  Size: 353 KiB