Hallo Leute, und zwar habe ich folgende Aufgabe (siehe Bild) und bin mit dem Quellcode soweit bzw. komme nicht weiter. An meinem bisherigen Quellcode ist auch etwas falsch. Kann mir jemand weiterhelfen?
public class Cocktail {
private String spirituose;
private String saft;
private boolean enthaeltSahne;
private boolean enthaeltAlkohol;
private boolean enthaeltKokos;
public Cocktail(String spirituose, String saft, boolean enthaeltSahne, boolean enthaeltAlkohol,
boolean enthaeltKokos) {
super();
this.spirituose = spirituose;
this.saft = saft;
this.enthaeltSahne = enthaeltSahne;
this.enthaeltAlkohol = enthaeltAlkohol;
this.enthaeltKokos = enthaeltKokos;
}
public String ermittleBezeichnung(){
}
}
public static void main(String[] args) {
Cocktail PinaColada = new Cocktail("Rum", "Ananas", true, true, true);
Cocktail VirginColada = new Cocktail(" ", "Ananas", true, false, true);
Cocktail AndererCocktail = new Cocktail();
}
}
public class Cocktail {
private String spirituose;
private String saft;
private boolean enthaeltSahne;
private boolean enthaeltAlkohol;
private boolean enthaeltKokos;
public Cocktail(String spirituose, String saft, boolean enthaeltSahne, boolean enthaeltAlkohol,
boolean enthaeltKokos) {
super();
this.spirituose = spirituose;
this.saft = saft;
this.enthaeltSahne = enthaeltSahne;
this.enthaeltAlkohol = enthaeltAlkohol;
this.enthaeltKokos = enthaeltKokos;
}
public String ermittleBezeichnung(){
}
}
public static void main(String[] args) {
Cocktail PinaColada = new Cocktail("Rum", "Ananas", true, true, true);
Cocktail VirginColada = new Cocktail(" ", "Ananas", true, false, true);
Cocktail AndererCocktail = new Cocktail();
}
}
Anhänge
Zuletzt bearbeitet: