I am struggling to find errors or help a couple of students with their app. Below is the code and the link to their app. The output does not work and she has changed here if else statements several times to make something happen. I would appreciate any help. Thanks
var restaurantType;
var price;
//declare the variable
onEvent(“restaurantType”, “change”, function( ) {
restaurantType = getText(“restaurantDropdown”);
updateScreen();
});
onEvent(“Price”, “change”, function( ) {
price = getNumber(“priceDropdown”);
updateScreen();
});
function updateScreen() {
if (restaurantType == “Mexican” && price == 10) {
setText(“restaurantSuggestion”, “We suggest you go to Taco Bell”);
} else if ((restaurantType == “American” && price == 10)) {
setText(“restaurantSuggestion”, “We suggest you go to McDonalds”);
} else if ((restaurantType == “Italian” && price == 10)) {
setText(“restaurantSuggestion”, “We suggest you go to Noodles and Company”);
} else if ((restaurantType == “Mexican” && price == 20)) {
setText(“restaurantSuggestion”, “We suggest you go to Que Pasa”);
} else if ((restaurantType == “American” && price == 20)) {
setText(“restaurantSuggestion”, “We sugesst you go to Sickies”);
} else {
setText(“restaurantSuggestion”, “We suggest you go to Olive Garden”);
}
}
This is the link to her app as it stands now - [Code.org - App Lab]