Build a recommendation engine that suggests items to a user by considering both price and geographic proximity. An item is eligible only if its price does not exceed the user's budget. Eligible items are then ranked from closest to farthest based on the user's current location.
price (numeric)latitude (float)longitude (float)latitude and longitude (floats).budget (numeric).Return the items that are within the budget, sorted in ascending order of Euclidean distance from the user's location. The output should include each item's price, location, and computed distance.
Input:
Output:
Explanation: The item priced at 150 is excluded because it exceeds the budget of 100. The remaining two items are sorted by distance; the item at (37.77, -122.42) is much closer than the one at (40.71, -74.01).
Input:
Output:
Explanation: The item at (0,0) costs 60, which is over budget. The other two items are both affordable; the one at (1,1) is nearer than the one at (3,4), so it appears first.
Your solution should include at least two test cases to demonstrate correctness.