The noodle bar keeps its menu in a map: dish name → price. Write on_menu(menu, dish) to return true if dish is on the menu and false if not. Different capitals mean a different dish.
on_menu({{"noodles", 12}, {"dumplings", 10}}, "noodles")→Trueon_menu({{"noodles", 12}, {"dumplings", 10}}, "pizza")→Falsebool on_menu(const map<string, int> &menu, const string &dish)#include <map>
#include <string>
using namespace std;
bool on_menu(const map<string, int> &menu, const string &dish) {
// your code here: is the dish on the menu?
return false;
}
Run tries the examples. When they look right, Submit.