Skip to content
Permalink
e3ef5d552b
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
79 lines (76 sloc) 1.85 KB
package model;
public class foodAndMenu {
public String foodname;
//We need to add the image in the foodAndMenu Contructor
//to commit
public String descriptionfood;
public String recipe;
//Constructor
public foodAndMenu(String a,String s, String k){
this.foodname=a;
this.descriptionfood=s;
this.recipe=k;
}
foodAndMenu appetizer;
foodAndMenu entree;
foodAndMenu desert;
foodAndMenu snack;
//Getters
public void setEntree(String x, String s, String k){
entree.foodname=x;
entree.descriptionfood=s;
entree.recipe=k;
}
public void setappetizer(String x,String s, String k){
appetizer.foodname=x;
appetizer.descriptionfood=s;
appetizer.recipe=k;
}
public void setdesert (String x,String s, String k){
desert.foodname=x;
desert.descriptionfood=s;
desert.recipe=k;
}
public void setsnack(String x,String s, String k){
snack.foodname=x;
snack.descriptionfood=s;
snack.recipe=k;
}
//Setters
public foodAndMenu getAppetizer(String k){
if (appetizer.foodname.equalsIgnoreCase(k)){
return appetizer;
}
else {
System.out.println("There is no such item on the menu");
return null;
}
}
public foodAndMenu getDesert(String k){
if (desert.foodname.equalsIgnoreCase(k)){
return desert;
}
else {
System.out.println("There is no such item on the menu");
return null;
}
}
public foodAndMenu getSnack(String k){
if (snack.foodname.equalsIgnoreCase(k)){
return snack;
}
else {
System.out.println("There is no such item on the menu");
return null;
}
}
public foodAndMenu getEntree(String k){
if (entree.foodname.equalsIgnoreCase(k)){
return entree;
}
else {
System.out.println("There is no such item on the menu");
return null;
}
}
}