-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexploreRecipe.java
40 lines (35 loc) · 1.61 KB
/
exploreRecipe.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import java.util.*;
public class ExploreRecipe {
public int explore(String selected, Recipe chosenRecipe) {
if (selected.equals("S") || selected.equals("s")) {
System.out.println("\n");
System.out.println("Recipe Name: " + chosenRecipe.gettitle());
System.out.println("\n");
System.out.println("Recipe Description: " + chosenRecipe.getDescription());
System.out.println("\n");
for(String printingredients : chosenRecipe.getIngridients()){
System.out.println("Recipe Ingredients: " + printingredients);
}
System.out.println("\n");
Scanner ready = new Scanner(System.in);
int ingredientindex = 0;
System.out.println("Press Enter when ready to see the next instruction");
String readyOrNot = ready.nextLine();
for(String printinstructions : chosenRecipe.getInstructions()){
System.out.print(printinstructions);
ready.nextLine();
}
System.out.println("\n");
System.out.println("*-------------------------------------------------------*");
System.out.println("End of instructions");
System.out.println("*-------------------------------------------------------*");
System.out.println("\n");
}
else if (selected.equals("e") || selected.equals("E")) {
System.out.println(chosenRecipe.userToString());
} else {
System.out.println("Option Unavailable");
}
return(0);
}
}