public class Resturant {
public static void main (String[] args) {
setNumberServings("");
setIngredients("");
setCookTemp("");
set(1,100);
public class AutomatedKitchen {
private int cookTemp;
private int cookTime;
private String cookedMeal;
private boolean healthyFood;
private String[] ingredientList;
private boolean mealReady;
private int nextArrayIndex = 0;
private int numberServings;
public static final int DEFAULT_COOK_TIME = 30;
public static final int DEFAULT_COOK_TEMP = 350;
public static final int DEFAULT_NUMBER_SERVINGS = 4;
public static final int MAX_INGREDIENTS = 10;
public AutomatedKitchen() {
ingredientList = new String[10];
this.numberServings = DEFAULT_NUMBER_SERVINGS;
this.cookTemp = DEFAULT_COOK_TEMP;
this.cookTime = DEFAULT_COOK_TIME;
this.healthyFood = false;
this.mealReady = false;
setIngredient("water");
}
public void cookMeal(){
mealReady = true;
}
public void serveMeal(){
if (mealReady = true) {
System.out.print("Serving a meal for " + numberServings + " ");
if (healthyFood){
System.out.println("This meal is healthy. ");
}
else{
System.out.println("This meal is unhealthy. ");
}
System.out.println("We cooked a blend of ");
for (int x = 0; x < nextArrayIndex; x++){
if ( x > 0){
if (x < nextArrayIndex -1){
System.out.print(", ");
}
else{
System.out.print(" and ");
}
}
System.out.println(ingredientList[x]);
}
System.out.println(" for " + cookTime + " minutes at " + cookTemp + " degrees.");
cookTemp(cookTemp);
}
}
public int getCookTemp() {
return cookTemp;
}
public void setCookTemp(int i) {
this.cookTemp = i;
}
public int getCookTime() {
return cookTime;
}
public void setCookTime(int i) {
this.cookTime = i;
}
public String getCookedMeal() {
return cookedMeal;
}
public void setCookedMeal(String cookedMeal) {
this.cookedMeal = cookedMeal;
}
public boolean getHealthyFood() {
return healthyFood;
}
public void setHealthyFood(boolean bln) {
this.healthyFood = bln;
}
public void setIngredient(String ingredient) {
if (nextArrayIndex < MAX_INGREDIENTS){
ingredientList[nextArrayIndex] = ingredient;
}
this.nextArrayIndex += 1;
}
public boolean readyToServe() {
return mealReady;
}
public void setReadyToServe(boolean mealReady) {
this.mealReady = mealReady;
}
public int getNumberServings() {
return numberServings;
}
public void setNumberServings(int numberServings) {
this.numberServings = numberServings;
}
public int getNumberIngredients(){
return nextArrayIndex +1;
}
public static void cookTemp(int sign){
if (sign >=300){
System.out.print("It's five start delicious.");
}
else if ( sign <=250){
System.out.print("It's terrible.");
}
}
public static void main(String [] javaa)
{
AutomatedKitchen a = new AutomatedKitchen();
a.cookMeal();
a.serveMeal();
}
}

New Topic/Question
Reply




MultiQuote








|