-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCocktail.java
More file actions
64 lines (56 loc) · 1.56 KB
/
Copy pathCocktail.java
File metadata and controls
64 lines (56 loc) · 1.56 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//Marcus Naess
//mjnaess19@ole.augie.edu
//Information on how to use the application is on GitHub
//https://github.com/0nab
import java.util.Scanner;
import java.util.Vector;
import java.io.*;
import java.util.*;
public class Cocktail {
private String name;
private String[] ingredients;
private String recipe;
//Post: name, ingredients, recipe.
public void Cocktail() {
name = "unknown";
ingredients[0] = "unknown";
recipe = "unknown";
}
public void Cocktail(String name, String[] ingredients, String recipe) {
this.name = name;
this.ingredients = ingredients;
this.recipe = recipe;
}
public void setName(String name){
this.name = name;
}
public void setIngredients(String[] ingredients){
this.ingredients = ingredients;
}
public void setRecipe(String recipe){
this.recipe = recipe;
}
public String getName(){
return name;
}
public String[] getIngredients(){
return ingredients;
}
public String getRecipe(){
return recipe;
}
public void toCocktailString() {
System.out.println("Name: " + this.name);
System.out.println("Ingredients: " + Arrays.toString(this.ingredients));
System.out.println("Recipe: " + this.recipe);
}
public String toCocktailStringReturn() {
return "<html>Name: " + this.name + "<br/>" + "Ingredients: " + Arrays.toString(this.ingredients) + "<br/>" + "Recipe: " + this.recipe + "<br/><br/><html/>";
}
public boolean doesContain(String str) {
for(String ingredient: this.ingredients){
if(ingredient.compareTo(str) == 0) return true;
}
return false;
}
}